Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 85.2% → 97.9%
Time: 7.4s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 85.2% accurate, 1.0× speedup?

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

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

Alternative 1: 97.9% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < -1.99999999999999985e-104 or 5e302 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 80.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
      4. add-log-exp61.8%

        \[\leadsto \color{blue}{\log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
      5. *-un-lft-identity61.8%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
      6. log-prod61.8%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
      7. metadata-eval61.8%

        \[\leadsto \color{blue}{0} + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right) \]
      8. add-log-exp72.7%

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

        \[\leadsto 0 + \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
      10. associate-*r/73.7%

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

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

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

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

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

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

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

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

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

    if -1.99999999999999985e-104 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 5e302

    1. Initial program 99.6%

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

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

Alternative 2: 96.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ y \cdot \frac{\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(y * Float64(Float64(cosh(x) / z) / x))
end
function tmp = code(x, y, z)
	tmp = y * ((cosh(x) / z) / x);
end
code[x_, y_, z_] := N[(y * N[(N[(N[Cosh[x], $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
    4. add-log-exp51.7%

      \[\leadsto \color{blue}{\log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
    5. *-un-lft-identity51.7%

      \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
    6. log-prod51.7%

      \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
    7. metadata-eval51.7%

      \[\leadsto \color{blue}{0} + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right) \]
    8. add-log-exp77.6%

      \[\leadsto 0 + \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
    9. associate-/l*84.5%

      \[\leadsto 0 + \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
    10. associate-*r/79.1%

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

    \[\leadsto \color{blue}{0 + \cosh x \cdot \frac{\frac{y}{x}}{z}} \]
  6. Step-by-step derivation
    1. +-lft-identity79.1%

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

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

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

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

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

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

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

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

Alternative 3: 67.7% accurate, 5.6× speedup?

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

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

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


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

    1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -390 < x

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 65.8% accurate, 7.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.95e-134

    1. Initial program 88.3%

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

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

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

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

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

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

    if -1.95e-134 < z

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.0% accurate, 7.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.00000000000000013e-63

    1. Initial program 88.9%

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

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

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

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

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

    if -2.00000000000000013e-63 < z

    1. Initial program 82.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
      4. add-log-exp53.3%

        \[\leadsto \color{blue}{\log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
      5. *-un-lft-identity53.3%

        \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
      6. log-prod53.3%

        \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
      7. metadata-eval53.3%

        \[\leadsto \color{blue}{0} + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right) \]
      8. add-log-exp77.5%

        \[\leadsto 0 + \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
      9. associate-/l*82.5%

        \[\leadsto 0 + \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
      10. associate-*r/78.5%

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

      \[\leadsto \color{blue}{0 + \cosh x \cdot \frac{\frac{y}{x}}{z}} \]
    6. Step-by-step derivation
      1. +-lft-identity78.5%

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

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

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

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

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

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

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

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

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

Alternative 6: 68.3% accurate, 7.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.00000000000000002e78

    1. Initial program 79.7%

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

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

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

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

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

    if -2.00000000000000002e78 < z

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 65.8% accurate, 8.2× speedup?

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

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

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


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

    1. Initial program 66.7%

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}} \]
    5. Taylor expanded in x around inf 53.1%

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

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

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

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

    if -7.9999999999999998e101 < x

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

Alternative 8: 65.9% accurate, 8.2× speedup?

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

    1. Initial program 66.7%

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}} \]
    5. Taylor expanded in x around inf 53.1%

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

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

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

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

    if -7.00000000000000021e102 < x

    1. Initial program 88.3%

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

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

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

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

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

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

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

Alternative 9: 66.1% accurate, 8.2× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
    4. add-log-exp51.7%

      \[\leadsto \color{blue}{\log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
    5. *-un-lft-identity51.7%

      \[\leadsto \log \color{blue}{\left(1 \cdot e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
    6. log-prod51.7%

      \[\leadsto \color{blue}{\log 1 + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right)} \]
    7. metadata-eval51.7%

      \[\leadsto \color{blue}{0} + \log \left(e^{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}}\right) \]
    8. add-log-exp77.6%

      \[\leadsto 0 + \color{blue}{\frac{\cosh x}{\frac{z}{\frac{y}{x}}}} \]
    9. associate-/l*84.5%

      \[\leadsto 0 + \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
    10. associate-*r/79.1%

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

    \[\leadsto \color{blue}{0 + \cosh x \cdot \frac{\frac{y}{x}}{z}} \]
  6. Step-by-step derivation
    1. +-lft-identity79.1%

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

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

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

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

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

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

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

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

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

Alternative 10: 66.3% accurate, 9.6× speedup?

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

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

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


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

    1. Initial program 78.0%

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}} \]
    5. Taylor expanded in x around inf 47.0%

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

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

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

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

    if -2.5 < x < 1.3999999999999999

    1. Initial program 91.4%

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

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

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

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

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

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

Alternative 11: 51.1% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 82.6%

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

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

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

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

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

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

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

    if 3.4999999999999999e-91 < y

    1. Initial program 89.0%

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

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

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

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

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

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

Alternative 12: 55.8% accurate, 15.2× speedup?

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

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

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


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

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

    if 3.3499999999999998e41 < z

    1. Initial program 77.7%

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

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

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

      \[\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}{x \cdot z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.6%

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

Alternative 13: 49.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 84.5%

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

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

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

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

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

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

Developer target: 96.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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