Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.9% → 99.5%
Time: 14.0s
Alternatives: 28
Speedup: 6.7×

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 28 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.9% 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.5% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh x\_m \cdot \frac{y\_m}{x\_m}}{z\_m} \leq 10^{+30}:\\ \;\;\;\;\frac{y\_m}{x\_m \cdot \frac{z\_m}{1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\cosh x\_m \cdot y\_m}{z\_m}}{x\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= (/ (* (cosh x_m) (/ y_m x_m)) z_m) 1e+30)
      (/
       y_m
       (*
        x_m
        (/
         z_m
         (+
          1.0
          (*
           x_m
           (*
            x_m
            (+
             0.5
             (*
              (* x_m x_m)
              (+
               0.041666666666666664
               (* (* x_m x_m) 0.001388888888888889))))))))))
      (/ (/ (* (cosh x_m) y_m) z_m) x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (((cosh(x_m) * (y_m / x_m)) / z_m) <= 1e+30) {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	} else {
		tmp = ((cosh(x_m) * y_m) / z_m) / x_m;
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (((cosh(x_m) * (y_m / x_m)) / z_m) <= 1d+30) then
        tmp = y_m / (x_m * (z_m / (1.0d0 + (x_m * (x_m * (0.5d0 + ((x_m * x_m) * (0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0)))))))))
    else
        tmp = ((cosh(x_m) * y_m) / z_m) / x_m
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (((Math.cosh(x_m) * (y_m / x_m)) / z_m) <= 1e+30) {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	} else {
		tmp = ((Math.cosh(x_m) * y_m) / z_m) / x_m;
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if ((math.cosh(x_m) * (y_m / x_m)) / z_m) <= 1e+30:
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))))
	else:
		tmp = ((math.cosh(x_m) * y_m) / z_m) / x_m
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (Float64(Float64(cosh(x_m) * Float64(y_m / x_m)) / z_m) <= 1e+30)
		tmp = Float64(y_m / Float64(x_m * Float64(z_m / Float64(1.0 + Float64(x_m * Float64(x_m * Float64(0.5 + Float64(Float64(x_m * x_m) * Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))))))))));
	else
		tmp = Float64(Float64(Float64(cosh(x_m) * y_m) / z_m) / x_m);
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (((cosh(x_m) * (y_m / x_m)) / z_m) <= 1e+30)
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	else
		tmp = ((cosh(x_m) * y_m) / z_m) / x_m;
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[N[(N[(N[Cosh[x$95$m], $MachinePrecision] * N[(y$95$m / x$95$m), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], 1e+30], N[(y$95$m / N[(x$95$m * N[(z$95$m / N[(1.0 + N[(x$95$m * N[(x$95$m * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cosh[x$95$m], $MachinePrecision] * y$95$m), $MachinePrecision] / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x\_m \cdot \frac{y\_m}{x\_m}}{z\_m} \leq 10^{+30}:\\
\;\;\;\;\frac{y\_m}{x\_m \cdot \frac{z\_m}{1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\right)\right)\right)}}\\

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


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

    1. Initial program 97.6%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified81.7%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\frac{1}{y}} \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}}\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{\frac{1}{y}}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}}\right)}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\frac{1}{y}} \cdot \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)\right)\right) \]
      9. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{1}{\color{blue}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}}\right)\right)\right) \]
    8. Applied egg-rr86.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)}}}}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}}{\color{blue}{x}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \color{blue}{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\frac{1}{24}} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    10. Applied egg-rr91.0%

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

    if 1e30 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 80.3%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

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

        \[\leadsto \frac{y \cdot \frac{\cosh x}{z}}{\color{blue}{x}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{\cosh x}{z}\right), \color{blue}{x}\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y \cdot \cosh x}{z}\right), x\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\cosh x \cdot y}{z}\right), x\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\cosh x \cdot y\right), z\right), x\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\cosh x, y\right), z\right), x\right) \]
      9. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cosh.f64}\left(x\right), y\right), z\right), x\right) \]
    3. Simplified100.0%

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

Alternative 2: 99.3% accurate, 0.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;\cosh x\_m \cdot \frac{y\_m}{x\_m} \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{\cosh x\_m}{x\_m}}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= (* (cosh x_m) (/ y_m x_m)) 5e+153)
      (/
       (*
        (/ y_m x_m)
        (+
         1.0
         (*
          x_m
          (*
           x_m
           (+
            0.5
            (*
             (* x_m x_m)
             (+
              0.041666666666666664
              (* x_m (* x_m 0.001388888888888889)))))))))
       z_m)
      (* y_m (/ (/ (cosh x_m) x_m) z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if ((cosh(x_m) * (y_m / x_m)) <= 5e+153) {
		tmp = ((y_m / x_m) * (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))))) / z_m;
	} else {
		tmp = y_m * ((cosh(x_m) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if ((cosh(x_m) * (y_m / x_m)) <= 5d+153) then
        tmp = ((y_m / x_m) * (1.0d0 + (x_m * (x_m * (0.5d0 + ((x_m * x_m) * (0.041666666666666664d0 + (x_m * (x_m * 0.001388888888888889d0))))))))) / z_m
    else
        tmp = y_m * ((cosh(x_m) / x_m) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if ((Math.cosh(x_m) * (y_m / x_m)) <= 5e+153) {
		tmp = ((y_m / x_m) * (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))))) / z_m;
	} else {
		tmp = y_m * ((Math.cosh(x_m) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if (math.cosh(x_m) * (y_m / x_m)) <= 5e+153:
		tmp = ((y_m / x_m) * (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))))) / z_m
	else:
		tmp = y_m * ((math.cosh(x_m) / x_m) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (Float64(cosh(x_m) * Float64(y_m / x_m)) <= 5e+153)
		tmp = Float64(Float64(Float64(y_m / x_m) * Float64(1.0 + Float64(x_m * Float64(x_m * Float64(0.5 + Float64(Float64(x_m * x_m) * Float64(0.041666666666666664 + Float64(x_m * Float64(x_m * 0.001388888888888889))))))))) / z_m);
	else
		tmp = Float64(y_m * Float64(Float64(cosh(x_m) / x_m) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if ((cosh(x_m) * (y_m / x_m)) <= 5e+153)
		tmp = ((y_m / x_m) * (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))))) / z_m;
	else
		tmp = y_m * ((cosh(x_m) / x_m) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[N[(N[Cosh[x$95$m], $MachinePrecision] * N[(y$95$m / x$95$m), $MachinePrecision]), $MachinePrecision], 5e+153], N[(N[(N[(y$95$m / x$95$m), $MachinePrecision] * N[(1.0 + N[(x$95$m * N[(x$95$m * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.041666666666666664 + N[(x$95$m * N[(x$95$m * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y$95$m * N[(N[(N[Cosh[x$95$m], $MachinePrecision] / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;\cosh x\_m \cdot \frac{y\_m}{x\_m} \leq 5 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{z\_m}\\

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


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

    1. Initial program 98.6%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(\left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right) \cdot x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right) \cdot x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left({x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \left(\frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \left({x}^{2} \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      14. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \left(x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      17. *-lowering-*.f6494.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified94.2%

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

    if 5.00000000000000018e153 < (*.f64 (cosh.f64 x) (/.f64 y x))

    1. Initial program 74.1%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\cosh x \cdot \frac{y}{x} \leq 5 \cdot 10^{+153}:\\ \;\;\;\;\frac{\frac{y}{x} \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{\cosh x}{x}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.7% accurate, 1.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_0 := 0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\\ t_1 := 0.5 + \left(x\_m \cdot x\_m\right) \cdot t\_0\\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{\frac{\left(\left(x\_m \cdot x\_m\right) \cdot \left(x\_m \cdot x\_m\right)\right) \cdot \left(t\_1 \cdot t\_1\right) + -1}{x\_m \cdot \left(x\_m \cdot t\_1\right) + -1}}{z\_m}}{\frac{x\_m}{y\_m}}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot t\_0\right)\right)}{x\_m}}{z\_m}\\ \end{array}\right)\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (let* ((t_0 (+ 0.041666666666666664 (* (* x_m x_m) 0.001388888888888889)))
        (t_1 (+ 0.5 (* (* x_m x_m) t_0))))
   (*
    z_s
    (*
     y_s
     (*
      x_s
      (if (<= x_m 7e+51)
        (/
         (/
          (/
           (+ (* (* (* x_m x_m) (* x_m x_m)) (* t_1 t_1)) -1.0)
           (+ (* x_m (* x_m t_1)) -1.0))
          z_m)
         (/ x_m y_m))
        (*
         y_m
         (/
          (/ (+ 1.0 (* (* x_m x_m) (+ 0.5 (* x_m (* x_m t_0))))) x_m)
          z_m))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889);
	double t_1 = 0.5 + ((x_m * x_m) * t_0);
	double tmp;
	if (x_m <= 7e+51) {
		tmp = ((((((x_m * x_m) * (x_m * x_m)) * (t_1 * t_1)) + -1.0) / ((x_m * (x_m * t_1)) + -1.0)) / z_m) / (x_m / y_m);
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * t_0))))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0)
    t_1 = 0.5d0 + ((x_m * x_m) * t_0)
    if (x_m <= 7d+51) then
        tmp = ((((((x_m * x_m) * (x_m * x_m)) * (t_1 * t_1)) + (-1.0d0)) / ((x_m * (x_m * t_1)) + (-1.0d0))) / z_m) / (x_m / y_m)
    else
        tmp = y_m * (((1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * t_0))))) / x_m) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889);
	double t_1 = 0.5 + ((x_m * x_m) * t_0);
	double tmp;
	if (x_m <= 7e+51) {
		tmp = ((((((x_m * x_m) * (x_m * x_m)) * (t_1 * t_1)) + -1.0) / ((x_m * (x_m * t_1)) + -1.0)) / z_m) / (x_m / y_m);
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * t_0))))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)
	t_1 = 0.5 + ((x_m * x_m) * t_0)
	tmp = 0
	if x_m <= 7e+51:
		tmp = ((((((x_m * x_m) * (x_m * x_m)) * (t_1 * t_1)) + -1.0) / ((x_m * (x_m * t_1)) + -1.0)) / z_m) / (x_m / y_m)
	else:
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * t_0))))) / x_m) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))
	t_1 = Float64(0.5 + Float64(Float64(x_m * x_m) * t_0))
	tmp = 0.0
	if (x_m <= 7e+51)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(x_m * x_m) * Float64(x_m * x_m)) * Float64(t_1 * t_1)) + -1.0) / Float64(Float64(x_m * Float64(x_m * t_1)) + -1.0)) / z_m) / Float64(x_m / y_m));
	else
		tmp = Float64(y_m * Float64(Float64(Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * t_0))))) / x_m) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889);
	t_1 = 0.5 + ((x_m * x_m) * t_0);
	tmp = 0.0;
	if (x_m <= 7e+51)
		tmp = ((((((x_m * x_m) * (x_m * x_m)) * (t_1 * t_1)) + -1.0) / ((x_m * (x_m * t_1)) + -1.0)) / z_m) / (x_m / y_m);
	else
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * t_0))))) / x_m) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 7e+51], N[(N[(N[(N[(N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(N[(x$95$m * N[(x$95$m * t$95$1), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(N[(N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\\
t_1 := 0.5 + \left(x\_m \cdot x\_m\right) \cdot t\_0\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\frac{\frac{\frac{\left(\left(x\_m \cdot x\_m\right) \cdot \left(x\_m \cdot x\_m\right)\right) \cdot \left(t\_1 \cdot t\_1\right) + -1}{x\_m \cdot \left(x\_m \cdot t\_1\right) + -1}}{z\_m}}{\frac{x\_m}{y\_m}}\\

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


\end{array}\right)\right)
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 7e51

    1. Initial program 89.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified80.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr87.6%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left(y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right) \cdot \color{blue}{\frac{1}{x}} \]
      2. remove-double-divN/A

        \[\leadsto \left(\frac{1}{\frac{1}{y}} \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right) \cdot \frac{1}{x} \]
      3. associate-/r/N/A

        \[\leadsto \frac{1}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}} \cdot \frac{\color{blue}{1}}{x} \]
      4. clear-numN/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}} \cdot \frac{\color{blue}{1}}{x} \]
      5. associate-*l/N/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z} \cdot \frac{1}{x}}{\color{blue}{\frac{1}{y}}} \]
      6. div-invN/A

        \[\leadsto \frac{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{x}}{\frac{\color{blue}{1}}{y}} \]
      7. associate-/r*N/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{x \cdot \frac{1}{y}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right), \color{blue}{\left(x \cdot \frac{1}{y}\right)}\right) \]
    8. Applied egg-rr80.4%

      \[\leadsto \color{blue}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)}{z}}{\frac{x}{y}}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right) + 1\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right) - 1 \cdot 1}{\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right) - 1}\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right) - 1 \cdot 1\right), \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right) - 1\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
    10. Applied egg-rr65.9%

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

    if 7e51 < x

    1. Initial program 87.3%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)}{x}\right)}, z\right), y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right), x\right), z\right), y\right) \]
    7. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{\frac{\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(\left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right) + -1}{x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right) + -1}}{z}}{\frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right)}{x}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.2% accurate, 1.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_0 := 0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\\ t_1 := x\_m \cdot t\_0\\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{1 + \frac{\left(x\_m \cdot x\_m\right) \cdot \left(0.25 - t\_0 \cdot \left(x\_m \cdot \left(\left(x\_m \cdot x\_m\right) \cdot t\_1\right)\right)\right)}{0.5 - \left(x\_m \cdot x\_m\right) \cdot t\_0}}{z\_m}}{\frac{x\_m}{y\_m}}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot t\_1\right)}{x\_m}}{z\_m}\\ \end{array}\right)\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (let* ((t_0 (+ 0.041666666666666664 (* (* x_m x_m) 0.001388888888888889)))
        (t_1 (* x_m t_0)))
   (*
    z_s
    (*
     y_s
     (*
      x_s
      (if (<= x_m 7e+51)
        (/
         (/
          (+
           1.0
           (/
            (* (* x_m x_m) (- 0.25 (* t_0 (* x_m (* (* x_m x_m) t_1)))))
            (- 0.5 (* (* x_m x_m) t_0))))
          z_m)
         (/ x_m y_m))
        (*
         y_m
         (/ (/ (+ 1.0 (* (* x_m x_m) (+ 0.5 (* x_m t_1)))) x_m) z_m))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889);
	double t_1 = x_m * t_0;
	double tmp;
	if (x_m <= 7e+51) {
		tmp = ((1.0 + (((x_m * x_m) * (0.25 - (t_0 * (x_m * ((x_m * x_m) * t_1))))) / (0.5 - ((x_m * x_m) * t_0)))) / z_m) / (x_m / y_m);
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * t_1)))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0)
    t_1 = x_m * t_0
    if (x_m <= 7d+51) then
        tmp = ((1.0d0 + (((x_m * x_m) * (0.25d0 - (t_0 * (x_m * ((x_m * x_m) * t_1))))) / (0.5d0 - ((x_m * x_m) * t_0)))) / z_m) / (x_m / y_m)
    else
        tmp = y_m * (((1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * t_1)))) / x_m) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889);
	double t_1 = x_m * t_0;
	double tmp;
	if (x_m <= 7e+51) {
		tmp = ((1.0 + (((x_m * x_m) * (0.25 - (t_0 * (x_m * ((x_m * x_m) * t_1))))) / (0.5 - ((x_m * x_m) * t_0)))) / z_m) / (x_m / y_m);
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * t_1)))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)
	t_1 = x_m * t_0
	tmp = 0
	if x_m <= 7e+51:
		tmp = ((1.0 + (((x_m * x_m) * (0.25 - (t_0 * (x_m * ((x_m * x_m) * t_1))))) / (0.5 - ((x_m * x_m) * t_0)))) / z_m) / (x_m / y_m)
	else:
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * t_1)))) / x_m) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))
	t_1 = Float64(x_m * t_0)
	tmp = 0.0
	if (x_m <= 7e+51)
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(x_m * x_m) * Float64(0.25 - Float64(t_0 * Float64(x_m * Float64(Float64(x_m * x_m) * t_1))))) / Float64(0.5 - Float64(Float64(x_m * x_m) * t_0)))) / z_m) / Float64(x_m / y_m));
	else
		tmp = Float64(y_m * Float64(Float64(Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * t_1)))) / x_m) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = 0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889);
	t_1 = x_m * t_0;
	tmp = 0.0;
	if (x_m <= 7e+51)
		tmp = ((1.0 + (((x_m * x_m) * (0.25 - (t_0 * (x_m * ((x_m * x_m) * t_1))))) / (0.5 - ((x_m * x_m) * t_0)))) / z_m) / (x_m / y_m);
	else
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * t_1)))) / x_m) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$95$m * t$95$0), $MachinePrecision]}, N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 7e+51], N[(N[(N[(1.0 + N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.25 - N[(t$95$0 * N[(x$95$m * N[(N[(x$95$m * x$95$m), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(N[(x$95$m * x$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(N[(N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\\
t_1 := x\_m \cdot t\_0\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\frac{\frac{1 + \frac{\left(x\_m \cdot x\_m\right) \cdot \left(0.25 - t\_0 \cdot \left(x\_m \cdot \left(\left(x\_m \cdot x\_m\right) \cdot t\_1\right)\right)\right)}{0.5 - \left(x\_m \cdot x\_m\right) \cdot t\_0}}{z\_m}}{\frac{x\_m}{y\_m}}\\

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


\end{array}\right)\right)
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 7e51

    1. Initial program 89.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified80.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr87.6%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left(y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right) \cdot \color{blue}{\frac{1}{x}} \]
      2. remove-double-divN/A

        \[\leadsto \left(\frac{1}{\frac{1}{y}} \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right) \cdot \frac{1}{x} \]
      3. associate-/r/N/A

        \[\leadsto \frac{1}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}} \cdot \frac{\color{blue}{1}}{x} \]
      4. clear-numN/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}} \cdot \frac{\color{blue}{1}}{x} \]
      5. associate-*l/N/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z} \cdot \frac{1}{x}}{\color{blue}{\frac{1}{y}}} \]
      6. div-invN/A

        \[\leadsto \frac{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{x}}{\frac{\color{blue}{1}}{y}} \]
      7. associate-/r*N/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{x \cdot \frac{1}{y}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right), \color{blue}{\left(x \cdot \frac{1}{y}\right)}\right) \]
    8. Applied egg-rr80.4%

      \[\leadsto \color{blue}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)}{z}}{\frac{x}{y}}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right) \cdot \left(x \cdot x\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}{\frac{1}{2} - \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)} \cdot \left(x \cdot x\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      3. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right) \cdot \left(x \cdot x\right)}{\frac{1}{2} - \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right) \cdot \left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right) \cdot \left(x \cdot x\right)\right), \left(\frac{1}{2} - \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
    10. Applied egg-rr67.4%

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

    if 7e51 < x

    1. Initial program 87.3%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)}{x}\right)}, z\right), y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right), x\right), z\right), y\right) \]
    7. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\frac{\frac{1 + \frac{\left(x \cdot x\right) \cdot \left(0.25 - \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right) \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{0.5 - \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)}}{z}}{\frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right)}{x}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 94.4% accurate, 3.1× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 10^{+21}:\\ \;\;\;\;\frac{1}{x\_m} \cdot \frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)}{z\_m}}{\frac{1}{y\_m}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m}{x\_m \cdot \frac{z\_m}{1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\right)\right)\right)}}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= z_m 1e+21)
      (*
       (/ 1.0 x_m)
       (/
        (/
         (+
          1.0
          (*
           (* x_m x_m)
           (+
            0.5
            (*
             (* x_m x_m)
             (+ 0.041666666666666664 (* x_m (* x_m 0.001388888888888889)))))))
         z_m)
        (/ 1.0 y_m)))
      (/
       y_m
       (*
        x_m
        (/
         z_m
         (+
          1.0
          (*
           x_m
           (*
            x_m
            (+
             0.5
             (*
              (* x_m x_m)
              (+
               0.041666666666666664
               (* (* x_m x_m) 0.001388888888888889)))))))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 1e+21) {
		tmp = (1.0 / x_m) * (((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (1.0 / y_m));
	} else {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (z_m <= 1d+21) then
        tmp = (1.0d0 / x_m) * (((1.0d0 + ((x_m * x_m) * (0.5d0 + ((x_m * x_m) * (0.041666666666666664d0 + (x_m * (x_m * 0.001388888888888889d0))))))) / z_m) / (1.0d0 / y_m))
    else
        tmp = y_m / (x_m * (z_m / (1.0d0 + (x_m * (x_m * (0.5d0 + ((x_m * x_m) * (0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0)))))))))
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 1e+21) {
		tmp = (1.0 / x_m) * (((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (1.0 / y_m));
	} else {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if z_m <= 1e+21:
		tmp = (1.0 / x_m) * (((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (1.0 / y_m))
	else:
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))))
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (z_m <= 1e+21)
		tmp = Float64(Float64(1.0 / x_m) * Float64(Float64(Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(Float64(x_m * x_m) * Float64(0.041666666666666664 + Float64(x_m * Float64(x_m * 0.001388888888888889))))))) / z_m) / Float64(1.0 / y_m)));
	else
		tmp = Float64(y_m / Float64(x_m * Float64(z_m / Float64(1.0 + Float64(x_m * Float64(x_m * Float64(0.5 + Float64(Float64(x_m * x_m) * Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))))))))));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (z_m <= 1e+21)
		tmp = (1.0 / x_m) * (((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (1.0 / y_m));
	else
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 1e+21], N[(N[(1.0 / x$95$m), $MachinePrecision] * N[(N[(N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.041666666666666664 + N[(x$95$m * N[(x$95$m * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / N[(1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m / N[(x$95$m * N[(z$95$m / N[(1.0 + N[(x$95$m * N[(x$95$m * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 10^{+21}:\\
\;\;\;\;\frac{1}{x\_m} \cdot \frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)}{z\_m}}{\frac{1}{y\_m}}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1e21

    1. Initial program 88.8%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified83.0%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. clear-numN/A

        \[\leadsto \frac{1}{\frac{x}{y}} \cdot \frac{\color{blue}{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}}{z} \]
      3. associate-*l/N/A

        \[\leadsto \frac{1 \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{\frac{x}{y}}} \]
      4. div-invN/A

        \[\leadsto \frac{1 \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{x \cdot \color{blue}{\frac{1}{y}}} \]
      5. times-fracN/A

        \[\leadsto \frac{1}{x} \cdot \color{blue}{\frac{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\frac{1}{y}}} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{x}\right), \color{blue}{\left(\frac{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\frac{1}{y}}\right)}\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, x\right), \left(\frac{\color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}}{\frac{1}{y}}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, x\right), \mathsf{/.f64}\left(\left(\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{\left(\frac{1}{y}\right)}\right)\right) \]
    6. Applied egg-rr92.4%

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

    if 1e21 < z

    1. Initial program 90.0%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified66.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr81.6%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\frac{1}{y}} \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}}\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{\frac{1}{y}}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}}\right)}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\frac{1}{y}} \cdot \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)\right)\right) \]
      9. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{1}{\color{blue}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}}\right)\right)\right) \]
    8. Applied egg-rr81.5%

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)}}}}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}}{\color{blue}{x}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \color{blue}{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\frac{1}{24}} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    10. Applied egg-rr94.0%

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

Alternative 6: 94.0% accurate, 3.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 4.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{y\_m \cdot \frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)}{z\_m}}{x\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m}{x\_m \cdot \frac{z\_m}{1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\right)\right)\right)}}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= z_m 4.5e-78)
      (/
       (*
        y_m
        (/
         (+
          1.0
          (*
           (* x_m x_m)
           (+
            0.5
            (*
             (* x_m x_m)
             (+ 0.041666666666666664 (* x_m (* x_m 0.001388888888888889)))))))
         z_m))
       x_m)
      (/
       y_m
       (*
        x_m
        (/
         z_m
         (+
          1.0
          (*
           x_m
           (*
            x_m
            (+
             0.5
             (*
              (* x_m x_m)
              (+
               0.041666666666666664
               (* (* x_m x_m) 0.001388888888888889)))))))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 4.5e-78) {
		tmp = (y_m * ((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m)) / x_m;
	} else {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (z_m <= 4.5d-78) then
        tmp = (y_m * ((1.0d0 + ((x_m * x_m) * (0.5d0 + ((x_m * x_m) * (0.041666666666666664d0 + (x_m * (x_m * 0.001388888888888889d0))))))) / z_m)) / x_m
    else
        tmp = y_m / (x_m * (z_m / (1.0d0 + (x_m * (x_m * (0.5d0 + ((x_m * x_m) * (0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0)))))))))
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 4.5e-78) {
		tmp = (y_m * ((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m)) / x_m;
	} else {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if z_m <= 4.5e-78:
		tmp = (y_m * ((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m)) / x_m
	else:
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))))
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (z_m <= 4.5e-78)
		tmp = Float64(Float64(y_m * Float64(Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(Float64(x_m * x_m) * Float64(0.041666666666666664 + Float64(x_m * Float64(x_m * 0.001388888888888889))))))) / z_m)) / x_m);
	else
		tmp = Float64(y_m / Float64(x_m * Float64(z_m / Float64(1.0 + Float64(x_m * Float64(x_m * Float64(0.5 + Float64(Float64(x_m * x_m) * Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))))))))));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (z_m <= 4.5e-78)
		tmp = (y_m * ((1.0 + ((x_m * x_m) * (0.5 + ((x_m * x_m) * (0.041666666666666664 + (x_m * (x_m * 0.001388888888888889))))))) / z_m)) / x_m;
	else
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 4.5e-78], N[(N[(y$95$m * N[(N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.041666666666666664 + N[(x$95$m * N[(x$95$m * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision], N[(y$95$m / N[(x$95$m * N[(z$95$m / N[(1.0 + N[(x$95$m * N[(x$95$m * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 4.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{y\_m \cdot \frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)}{z\_m}}{x\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.5e-78

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified82.2%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr92.6%

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

    if 4.5e-78 < z

    1. Initial program 88.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified73.2%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr84.0%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\frac{1}{y}} \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}}\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{\frac{1}{y}}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}}\right)}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\frac{1}{y}} \cdot \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)\right)\right) \]
      9. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{1}{\color{blue}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}}\right)\right)\right) \]
    8. Applied egg-rr84.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)}}}}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}}{\color{blue}{x}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \color{blue}{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\frac{1}{24}} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    10. Applied egg-rr92.9%

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

Alternative 7: 94.0% accurate, 3.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 4.1 \cdot 10^{-78}:\\ \;\;\;\;\frac{1}{\frac{x\_m}{\frac{y\_m}{\frac{z\_m}{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)\right)}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m}{x\_m \cdot \frac{z\_m}{1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot \left(0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\right)\right)\right)}}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= z_m 4.1e-78)
      (/
       1.0
       (/
        x_m
        (/
         y_m
         (/
          z_m
          (+
           1.0
           (*
            (* x_m x_m)
            (+ 0.5 (* x_m (* x_m (* x_m (* x_m 0.001388888888888889)))))))))))
      (/
       y_m
       (*
        x_m
        (/
         z_m
         (+
          1.0
          (*
           x_m
           (*
            x_m
            (+
             0.5
             (*
              (* x_m x_m)
              (+
               0.041666666666666664
               (* (* x_m x_m) 0.001388888888888889)))))))))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 4.1e-78) {
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))));
	} else {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (z_m <= 4.1d-78) then
        tmp = 1.0d0 / (x_m / (y_m / (z_m / (1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889d0))))))))))
    else
        tmp = y_m / (x_m * (z_m / (1.0d0 + (x_m * (x_m * (0.5d0 + ((x_m * x_m) * (0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0)))))))))
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 4.1e-78) {
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))));
	} else {
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if z_m <= 4.1e-78:
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))))
	else:
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))))
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (z_m <= 4.1e-78)
		tmp = Float64(1.0 / Float64(x_m / Float64(y_m / Float64(z_m / Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * Float64(x_m * Float64(x_m * 0.001388888888888889)))))))))));
	else
		tmp = Float64(y_m / Float64(x_m * Float64(z_m / Float64(1.0 + Float64(x_m * Float64(x_m * Float64(0.5 + Float64(Float64(x_m * x_m) * Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))))))))));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (z_m <= 4.1e-78)
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))));
	else
		tmp = y_m / (x_m * (z_m / (1.0 + (x_m * (x_m * (0.5 + ((x_m * x_m) * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889)))))))));
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 4.1e-78], N[(1.0 / N[(x$95$m / N[(y$95$m / N[(z$95$m / N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * N[(x$95$m * N[(x$95$m * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m / N[(x$95$m * N[(z$95$m / N[(1.0 + N[(x$95$m * N[(x$95$m * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.0999999999999998e-78

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified82.2%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr92.6%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\frac{1}{y}} \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}}\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{\frac{1}{y}}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}}\right)}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\frac{1}{y}} \cdot \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)\right)\right) \]
      9. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{1}{\color{blue}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}}\right)\right)\right) \]
    8. Applied egg-rr92.6%

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

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{720} \cdot {x}^{4}\right)}\right)\right)\right)\right)\right)\right)\right) \]
    10. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{720} \cdot {x}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      2. pow-sqrN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{720} \cdot \left({x}^{2} \cdot \color{blue}{{x}^{2}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{720} \cdot {x}^{2}\right) \cdot \color{blue}{{x}^{2}}\right)\right)\right)\right)\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{720} \cdot {x}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\frac{1}{720}} \cdot {x}^{2}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{720} \cdot {x}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(x \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f6492.6%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    11. Simplified92.6%

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

    if 4.0999999999999998e-78 < z

    1. Initial program 88.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified73.2%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr84.0%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\frac{1}{y}} \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}}\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{\frac{1}{y}}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}}\right)}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\frac{1}{y}} \cdot \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)\right)\right) \]
      9. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{1}{\color{blue}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}}\right)\right)\right) \]
    8. Applied egg-rr84.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)}}}}} \]
    9. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}}{\color{blue}{x}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{y}{\color{blue}{x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \color{blue}{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \left(x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)}\right)\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\left(\frac{1}{24} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\color{blue}{\frac{1}{24}} + \left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(x \cdot x\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    10. Applied egg-rr92.9%

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

Alternative 8: 93.8% accurate, 3.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 2.5 \cdot 10^{-71}:\\ \;\;\;\;\frac{1}{\frac{x\_m}{\frac{y\_m}{\frac{z\_m}{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)\right)}}}}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot \left(0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\right)\right)\right)}{x\_m}}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= z_m 2.5e-71)
      (/
       1.0
       (/
        x_m
        (/
         y_m
         (/
          z_m
          (+
           1.0
           (*
            (* x_m x_m)
            (+ 0.5 (* x_m (* x_m (* x_m (* x_m 0.001388888888888889)))))))))))
      (*
       y_m
       (/
        (/
         (+
          1.0
          (*
           (* x_m x_m)
           (+
            0.5
            (*
             x_m
             (*
              x_m
              (+
               0.041666666666666664
               (* (* x_m x_m) 0.001388888888888889)))))))
         x_m)
        z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 2.5e-71) {
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))));
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (z_m <= 2.5d-71) then
        tmp = 1.0d0 / (x_m / (y_m / (z_m / (1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889d0))))))))))
    else
        tmp = y_m * (((1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * (0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0))))))) / x_m) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 2.5e-71) {
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))));
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if z_m <= 2.5e-71:
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))))
	else:
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (z_m <= 2.5e-71)
		tmp = Float64(1.0 / Float64(x_m / Float64(y_m / Float64(z_m / Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * Float64(x_m * Float64(x_m * 0.001388888888888889)))))))))));
	else
		tmp = Float64(y_m * Float64(Float64(Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (z_m <= 2.5e-71)
		tmp = 1.0 / (x_m / (y_m / (z_m / (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))))));
	else
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 2.5e-71], N[(1.0 / N[(x$95$m / N[(y$95$m / N[(z$95$m / N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * N[(x$95$m * N[(x$95$m * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(N[(N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.49999999999999999e-71

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified82.6%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr92.8%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{x}{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)}\right) \]
      3. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\frac{1}{y}} \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}}\right)\right) \]
      4. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}}\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{x}{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{\frac{1}{y}}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{\left(\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}}\right)}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\color{blue}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}}}\right)\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(\frac{1}{\frac{1}{y}} \cdot \color{blue}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}\right)\right)\right) \]
      9. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{\color{blue}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}{z}\right)\right)\right) \]
      10. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \left(y \cdot \frac{1}{\color{blue}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}}}\right)\right)\right) \]
    8. Applied egg-rr92.8%

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

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{720} \cdot {x}^{4}\right)}\right)\right)\right)\right)\right)\right)\right) \]
    10. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{720} \cdot {x}^{\left(2 \cdot \color{blue}{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      2. pow-sqrN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{720} \cdot \left({x}^{2} \cdot \color{blue}{{x}^{2}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{720} \cdot {x}^{2}\right) \cdot \color{blue}{{x}^{2}}\right)\right)\right)\right)\right)\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left({x}^{2} \cdot \color{blue}{\left(\frac{1}{720} \cdot {x}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(x \cdot x\right) \cdot \left(\color{blue}{\frac{1}{720}} \cdot {x}^{2}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \color{blue}{\left(x \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{720} \cdot {x}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(x \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(x \cdot \frac{1}{720}\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f6492.8%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(x, \mathsf{/.f64}\left(y, \mathsf{/.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
    11. Simplified92.8%

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

    if 2.49999999999999999e-71 < z

    1. Initial program 89.4%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)}{x}\right)}, z\right), y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right), x\right), z\right), y\right) \]
    7. Simplified92.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2.5 \cdot 10^{-71}:\\ \;\;\;\;\frac{1}{\frac{x}{\frac{y}{\frac{z}{1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)}}}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right)}{x}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 93.6% accurate, 3.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 1.05 \cdot 10^{-69}:\\ \;\;\;\;\frac{y\_m \cdot \left(\frac{1}{z\_m} + \frac{x\_m \cdot x\_m}{z\_m} \cdot \left(0.5 + \left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\right)\right)}{x\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot \left(0.041666666666666664 + \left(x\_m \cdot x\_m\right) \cdot 0.001388888888888889\right)\right)\right)}{x\_m}}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= z_m 1.05e-69)
      (/
       (*
        y_m
        (+
         (/ 1.0 z_m)
         (* (/ (* x_m x_m) z_m) (+ 0.5 (* (* x_m x_m) 0.041666666666666664)))))
       x_m)
      (*
       y_m
       (/
        (/
         (+
          1.0
          (*
           (* x_m x_m)
           (+
            0.5
            (*
             x_m
             (*
              x_m
              (+
               0.041666666666666664
               (* (* x_m x_m) 0.001388888888888889)))))))
         x_m)
        z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 1.05e-69) {
		tmp = (y_m * ((1.0 / z_m) + (((x_m * x_m) / z_m) * (0.5 + ((x_m * x_m) * 0.041666666666666664))))) / x_m;
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (z_m <= 1.05d-69) then
        tmp = (y_m * ((1.0d0 / z_m) + (((x_m * x_m) / z_m) * (0.5d0 + ((x_m * x_m) * 0.041666666666666664d0))))) / x_m
    else
        tmp = y_m * (((1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * (0.041666666666666664d0 + ((x_m * x_m) * 0.001388888888888889d0))))))) / x_m) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 1.05e-69) {
		tmp = (y_m * ((1.0 / z_m) + (((x_m * x_m) / z_m) * (0.5 + ((x_m * x_m) * 0.041666666666666664))))) / x_m;
	} else {
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if z_m <= 1.05e-69:
		tmp = (y_m * ((1.0 / z_m) + (((x_m * x_m) / z_m) * (0.5 + ((x_m * x_m) * 0.041666666666666664))))) / x_m
	else:
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (z_m <= 1.05e-69)
		tmp = Float64(Float64(y_m * Float64(Float64(1.0 / z_m) + Float64(Float64(Float64(x_m * x_m) / z_m) * Float64(0.5 + Float64(Float64(x_m * x_m) * 0.041666666666666664))))) / x_m);
	else
		tmp = Float64(y_m * Float64(Float64(Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * Float64(0.041666666666666664 + Float64(Float64(x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (z_m <= 1.05e-69)
		tmp = (y_m * ((1.0 / z_m) + (((x_m * x_m) / z_m) * (0.5 + ((x_m * x_m) * 0.041666666666666664))))) / x_m;
	else
		tmp = y_m * (((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (0.041666666666666664 + ((x_m * x_m) * 0.001388888888888889))))))) / x_m) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 1.05e-69], N[(N[(y$95$m * N[(N[(1.0 / z$95$m), $MachinePrecision] + N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision] * N[(0.5 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision], N[(y$95$m * N[(N[(N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * N[(0.041666666666666664 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

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

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.05e-69

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified82.7%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr92.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right)}\right), x\right) \]
    8. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{1}{z} + {x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right)\right)\right), x\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\left(\frac{1}{z}\right), \left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right)\right)\right)\right), x\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right)\right)\right)\right), x\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{z} + \frac{1}{24} \cdot \frac{{x}^{2}}{z}\right)\right)\right)\right), x\right) \]
      5. distribute-rgt-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\left(\frac{1}{2} \cdot \frac{1}{z}\right) \cdot {x}^{2} + \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z}\right) \cdot {x}^{2}\right)\right)\right), x\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\frac{1}{2} \cdot \left(\frac{1}{z} \cdot {x}^{2}\right) + \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z}\right) \cdot {x}^{2}\right)\right)\right), x\right) \]
      7. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\frac{1}{2} \cdot \frac{1 \cdot {x}^{2}}{z} + \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z}\right) \cdot {x}^{2}\right)\right)\right), x\right) \]
      8. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\frac{1}{2} \cdot \frac{{x}^{2}}{z} + \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z}\right) \cdot {x}^{2}\right)\right)\right), x\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\frac{{x}^{2}}{z} \cdot \frac{1}{2} + \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z}\right) \cdot {x}^{2}\right)\right)\right), x\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\frac{{x}^{2}}{z} \cdot \frac{1}{2} + \left(\frac{{x}^{2}}{z} \cdot \frac{1}{24}\right) \cdot {x}^{2}\right)\right)\right), x\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\frac{{x}^{2}}{z} \cdot \frac{1}{2} + \frac{{x}^{2}}{z} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), x\right) \]
      12. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \left(\frac{{x}^{2}}{z} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), x\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \mathsf{*.f64}\left(\left(\frac{{x}^{2}}{z}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), x\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2}\right), z\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), x\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot x\right), z\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), x\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), z\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), x\right) \]
      17. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), z\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right)\right), x\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), z\right), \mathsf{+.f64}\left(\frac{1}{2}, \left({x}^{2} \cdot \frac{1}{24}\right)\right)\right)\right)\right), x\right) \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, z\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), z\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({x}^{2}\right), \frac{1}{24}\right)\right)\right)\right)\right), x\right) \]
    9. Simplified89.7%

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

    if 1.05e-69 < z

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f6499.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)}{x}\right)}, z\right), y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + {x}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {x}^{2}\right)\right)\right), x\right), z\right), y\right) \]
    7. Simplified92.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.05 \cdot 10^{-69}:\\ \;\;\;\;\frac{y \cdot \left(\frac{1}{z} + \frac{x \cdot x}{z} \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot \left(0.041666666666666664 + \left(x \cdot x\right) \cdot 0.001388888888888889\right)\right)\right)}{x}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 90.0% accurate, 3.8× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 4.8 \cdot 10^{+72}:\\ \;\;\;\;\frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)\right)}{z\_m}}{\frac{x\_m}{y\_m}}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{\left(x\_m \cdot x\_m\right) \cdot \left(\left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\right)}{z\_m}}{x\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 4.8e+72)
      (/
       (/
        (+
         1.0
         (*
          (* x_m x_m)
          (+ 0.5 (* x_m (* x_m (* x_m (* x_m 0.001388888888888889)))))))
        z_m)
       (/ x_m y_m))
      (*
       y_m
       (/
        (/ (* (* x_m x_m) (* (* x_m x_m) 0.041666666666666664)) z_m)
        x_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 4.8e+72) {
		tmp = ((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (x_m / y_m);
	} else {
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 4.8d+72) then
        tmp = ((1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889d0))))))) / z_m) / (x_m / y_m)
    else
        tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664d0)) / z_m) / x_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 4.8e+72) {
		tmp = ((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (x_m / y_m);
	} else {
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 4.8e+72:
		tmp = ((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (x_m / y_m)
	else:
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 4.8e+72)
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * Float64(x_m * Float64(x_m * 0.001388888888888889))))))) / z_m) / Float64(x_m / y_m));
	else
		tmp = Float64(y_m * Float64(Float64(Float64(Float64(x_m * x_m) * Float64(Float64(x_m * x_m) * 0.041666666666666664)) / z_m) / x_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 4.8e+72)
		tmp = ((1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * (x_m * (x_m * 0.001388888888888889))))))) / z_m) / (x_m / y_m);
	else
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 4.8e+72], N[(N[(N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * N[(x$95$m * N[(x$95$m * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / N[(x$95$m / y$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 4.8 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot 0.001388888888888889\right)\right)\right)\right)}{z\_m}}{\frac{x\_m}{y\_m}}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 4.8000000000000002e72

    1. Initial program 89.8%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{y}{z} + {x}^{2} \cdot \left(\frac{1}{720} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{1}{24} \cdot \frac{y}{z}\right)\right) + \frac{y}{z}}{x}} \]
    4. Simplified79.7%

      \[\leadsto \color{blue}{\frac{y \cdot \left(1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)\right)}{x \cdot z}} \]
    5. Step-by-step derivation
      1. times-fracN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}} \]
      2. associate-*l/N/A

        \[\leadsto \frac{y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}}{\color{blue}{x}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1 + x \cdot \left(x \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)}{z}\right), \color{blue}{x}\right) \]
    6. Applied egg-rr87.9%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + \left(x \cdot x\right) \cdot \left(0.041666666666666664 + x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)}{z}}{x}} \]
    7. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left(y \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right) \cdot \color{blue}{\frac{1}{x}} \]
      2. remove-double-divN/A

        \[\leadsto \left(\frac{1}{\frac{1}{y}} \cdot \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right) \cdot \frac{1}{x} \]
      3. associate-/r/N/A

        \[\leadsto \frac{1}{\frac{\frac{1}{y}}{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}} \cdot \frac{\color{blue}{1}}{x} \]
      4. clear-numN/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\frac{1}{y}} \cdot \frac{\color{blue}{1}}{x} \]
      5. associate-*l/N/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z} \cdot \frac{1}{x}}{\color{blue}{\frac{1}{y}}} \]
      6. div-invN/A

        \[\leadsto \frac{\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{x}}{\frac{\color{blue}{1}}{y}} \]
      7. associate-/r*N/A

        \[\leadsto \frac{\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}}{\color{blue}{x \cdot \frac{1}{y}}} \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + \left(x \cdot x\right) \cdot \left(\frac{1}{24} + x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)}{z}\right), \color{blue}{\left(x \cdot \frac{1}{y}\right)}\right) \]
    8. Applied egg-rr80.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{720} \cdot {x}^{4}\right)}\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
    10. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{720} \cdot {x}^{\left(2 \cdot 2\right)}\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      2. pow-sqrN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{720} \cdot \left({x}^{2} \cdot {x}^{2}\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{720} \cdot {x}^{2}\right) \cdot {x}^{2}\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left({x}^{2} \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(x \cdot x\right) \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(x \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\frac{1}{720} \cdot {x}^{2}\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(x \cdot x\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      11. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot \left(x \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
      13. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(x, y\right)\right) \]
    11. Simplified80.6%

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

    if 4.8000000000000002e72 < x

    1. Initial program 86.0%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified96.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \frac{{x}^{4}}{z}\right)}, x\right), y\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{4}}{z}\right), x\right), y\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{\left(2 \cdot 2\right)}}{z}\right), x\right), y\right) \]
      3. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot \left({x}^{2} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot {x}^{2}}{z}\right), x\right), y\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      13. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
    10. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.8 \cdot 10^{+72}:\\ \;\;\;\;\frac{\frac{1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.001388888888888889\right)\right)\right)\right)}{z}}{\frac{x}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)}{z}}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 86.6% accurate, 4.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 3.75:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + 0.5 \cdot \left(x\_m \cdot x\_m\right)\right)}{z\_m}\\ \mathbf{elif}\;x\_m \leq 8.2 \cdot 10^{+88}:\\ \;\;\;\;\frac{y\_m}{x\_m} \cdot \frac{x\_m \cdot \left(x\_m \cdot \left(\left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\right)\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(y\_m \cdot 0.041666666666666664\right) \cdot \frac{x\_m \cdot \left(x\_m \cdot x\_m\right)}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 3.75)
      (/ (* (/ y_m x_m) (+ 1.0 (* 0.5 (* x_m x_m)))) z_m)
      (if (<= x_m 8.2e+88)
        (*
         (/ y_m x_m)
         (/ (* x_m (* x_m (* (* x_m x_m) 0.041666666666666664))) z_m))
        (* (* y_m 0.041666666666666664) (/ (* x_m (* x_m x_m)) z_m))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	} else if (x_m <= 8.2e+88) {
		tmp = (y_m / x_m) * ((x_m * (x_m * ((x_m * x_m) * 0.041666666666666664))) / z_m);
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 3.75d0) then
        tmp = ((y_m / x_m) * (1.0d0 + (0.5d0 * (x_m * x_m)))) / z_m
    else if (x_m <= 8.2d+88) then
        tmp = (y_m / x_m) * ((x_m * (x_m * ((x_m * x_m) * 0.041666666666666664d0))) / z_m)
    else
        tmp = (y_m * 0.041666666666666664d0) * ((x_m * (x_m * x_m)) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	} else if (x_m <= 8.2e+88) {
		tmp = (y_m / x_m) * ((x_m * (x_m * ((x_m * x_m) * 0.041666666666666664))) / z_m);
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 3.75:
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m
	elif x_m <= 8.2e+88:
		tmp = (y_m / x_m) * ((x_m * (x_m * ((x_m * x_m) * 0.041666666666666664))) / z_m)
	else:
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 3.75)
		tmp = Float64(Float64(Float64(y_m / x_m) * Float64(1.0 + Float64(0.5 * Float64(x_m * x_m)))) / z_m);
	elseif (x_m <= 8.2e+88)
		tmp = Float64(Float64(y_m / x_m) * Float64(Float64(x_m * Float64(x_m * Float64(Float64(x_m * x_m) * 0.041666666666666664))) / z_m));
	else
		tmp = Float64(Float64(y_m * 0.041666666666666664) * Float64(Float64(x_m * Float64(x_m * x_m)) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 3.75)
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	elseif (x_m <= 8.2e+88)
		tmp = (y_m / x_m) * ((x_m * (x_m * ((x_m * x_m) * 0.041666666666666664))) / z_m);
	else
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 3.75], N[(N[(N[(y$95$m / x$95$m), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], If[LessEqual[x$95$m, 8.2e+88], N[(N[(y$95$m / x$95$m), $MachinePrecision] * N[(N[(x$95$m * N[(x$95$m * N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * 0.041666666666666664), $MachinePrecision] * N[(N[(x$95$m * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3.75:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + 0.5 \cdot \left(x\_m \cdot x\_m\right)\right)}{z\_m}\\

\mathbf{elif}\;x\_m \leq 8.2 \cdot 10^{+88}:\\
\;\;\;\;\frac{y\_m}{x\_m} \cdot \frac{x\_m \cdot \left(x\_m \cdot \left(\left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\right)\right)}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 3.75

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {x}^{2}\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left({x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified77.0%

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

    if 3.75 < x < 8.20000000000000055e88

    1. Initial program 100.0%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6452.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified52.1%

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

        \[\leadsto \frac{\frac{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right) \cdot y}{x}}{z} \]
      2. associate-/l/N/A

        \[\leadsto \frac{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right) \cdot y}{\color{blue}{z \cdot x}} \]
      3. times-fracN/A

        \[\leadsto \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)}{z} \cdot \color{blue}{\frac{y}{x}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)}{z}\right), \color{blue}{\left(\frac{y}{x}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right), z\right), \left(\frac{\color{blue}{y}}{x}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      11. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(x \cdot x\right) \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      14. /-lowering-/.f6464.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(y, \color{blue}{x}\right)\right) \]
    7. Applied egg-rr64.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot {x}^{4}\right)}, z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
    9. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{24} \cdot {x}^{\left(2 \cdot 2\right)}\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      2. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{24} \cdot \left({x}^{2} \cdot {x}^{2}\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot {x}^{2}\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\left(x \cdot x\right) \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot \left(x \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot \left(\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot x\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot \left(\frac{1}{24} \cdot \left({x}^{2} \cdot x\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot \left(\frac{1}{24} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      10. unpow3N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot \left(\frac{1}{24} \cdot {x}^{3}\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot {x}^{3}\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      12. unpow3N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot \left({x}^{2} \cdot x\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot x\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \frac{1}{24}\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left({x}^{2}\right), \frac{1}{24}\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{24}\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
      20. *-lowering-*.f6464.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right)\right), z\right), \mathsf{/.f64}\left(y, x\right)\right) \]
    10. Simplified64.7%

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

    if 8.20000000000000055e88 < x

    1. Initial program 83.7%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6483.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified83.7%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \left({x}^{3} \cdot y\right)\right)}, z\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left({x}^{3} \cdot y\right)\right), z\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left(y \cdot {x}^{3}\right)\right), z\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left({x}^{3}\right)\right)\right), z\right) \]
      4. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot \left(x \cdot x\right)\right)\right)\right), z\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot {x}^{2}\right)\right)\right), z\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right)\right), z\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right)\right), z\right) \]
      8. *-lowering-*.f6497.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), z\right) \]
    8. Simplified97.8%

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

        \[\leadsto \frac{\left(\frac{1}{24} \cdot y\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)}{z} \]
      2. associate-/l*N/A

        \[\leadsto \left(\frac{1}{24} \cdot y\right) \cdot \color{blue}{\frac{x \cdot \left(x \cdot x\right)}{z}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{24} \cdot y\right), \color{blue}{\left(\frac{x \cdot \left(x \cdot x\right)}{z}\right)}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(y \cdot \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\left(x \cdot \left(x \cdot x\right)\right), \color{blue}{z}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot x\right)\right), z\right)\right) \]
      8. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), z\right)\right) \]
    10. Applied egg-rr100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.75:\\ \;\;\;\;\frac{\frac{y}{x} \cdot \left(1 + 0.5 \cdot \left(x \cdot x\right)\right)}{z}\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+88}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{x \cdot \left(x \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot 0.041666666666666664\right) \cdot \frac{x \cdot \left(x \cdot x\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 92.0% accurate, 4.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_0 := y\_m \cdot \left(1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot 0.041666666666666664\right)\right)\right)\\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 1.65 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{t\_0}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t\_0}{z\_m}}{x\_m}\\ \end{array}\right)\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (let* ((t_0
         (*
          y_m
          (+
           1.0
           (* (* x_m x_m) (+ 0.5 (* x_m (* x_m 0.041666666666666664))))))))
   (*
    z_s
    (*
     y_s
     (* x_s (if (<= y_m 1.65e-50) (/ (/ t_0 x_m) z_m) (/ (/ t_0 z_m) x_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))));
	double tmp;
	if (y_m <= 1.65e-50) {
		tmp = (t_0 / x_m) / z_m;
	} else {
		tmp = (t_0 / z_m) / x_m;
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y_m * (1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * 0.041666666666666664d0)))))
    if (y_m <= 1.65d-50) then
        tmp = (t_0 / x_m) / z_m
    else
        tmp = (t_0 / z_m) / x_m
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))));
	double tmp;
	if (y_m <= 1.65e-50) {
		tmp = (t_0 / x_m) / z_m;
	} else {
		tmp = (t_0 / z_m) / x_m;
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	t_0 = y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))
	tmp = 0
	if y_m <= 1.65e-50:
		tmp = (t_0 / x_m) / z_m
	else:
		tmp = (t_0 / z_m) / x_m
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = Float64(y_m * Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * 0.041666666666666664))))))
	tmp = 0.0
	if (y_m <= 1.65e-50)
		tmp = Float64(Float64(t_0 / x_m) / z_m);
	else
		tmp = Float64(Float64(t_0 / z_m) / x_m);
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))));
	tmp = 0.0;
	if (y_m <= 1.65e-50)
		tmp = (t_0 / x_m) / z_m;
	else
		tmp = (t_0 / z_m) / x_m;
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := Block[{t$95$0 = N[(y$95$m * N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[y$95$m, 1.65e-50], N[(N[(t$95$0 / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(t$95$0 / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
\begin{array}{l}
t_0 := y\_m \cdot \left(1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot 0.041666666666666664\right)\right)\right)\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 1.65 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{t\_0}{x\_m}}{z\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{t\_0}{z\_m}}{x\_m}\\


\end{array}\right)\right)
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.6499999999999999e-50

    1. Initial program 86.1%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y + {x}^{2} \cdot \left(\frac{1}{24} \cdot \left({x}^{2} \cdot y\right) + \frac{1}{2} \cdot y\right)}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y + {x}^{2} \cdot \left(\frac{1}{24} \cdot \left({x}^{2} \cdot y\right) + \frac{1}{2} \cdot y\right)\right), x\right), z\right) \]
    5. Simplified86.5%

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

    if 1.6499999999999999e-50 < y

    1. Initial program 96.1%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

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

        \[\leadsto \frac{y \cdot \frac{\cosh x}{z}}{\color{blue}{x}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{\cosh x}{z}\right), \color{blue}{x}\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y \cdot \cosh x}{z}\right), x\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\cosh x \cdot y}{z}\right), x\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\cosh x \cdot y\right), z\right), x\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\cosh x, y\right), z\right), x\right) \]
      9. cosh-lowering-cosh.f6499.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{cosh.f64}\left(x\right), y\right), z\right), x\right) \]
    3. Simplified99.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, y\right), z\right), x\right) \]
    6. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), y\right), z\right), x\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), y\right), z\right), x\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), y\right), z\right), x\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), y\right), z\right), x\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), y\right), z\right), x\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), y\right), z\right), x\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), y\right), z\right), x\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), y\right), z\right), x\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), y\right), z\right), x\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), y\right), z\right), x\right) \]
      11. *-lowering-*.f6494.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), y\right), z\right), x\right) \]
    7. Simplified94.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.65 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{y \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)}{z}}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 88.0% accurate, 4.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 200000000000:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot 0.041666666666666664\right)\right)\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{\left(x\_m \cdot x\_m\right) \cdot \left(\left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\right)}{z\_m}}{x\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 200000000000.0)
      (/
       (*
        (/ y_m x_m)
        (+ 1.0 (* (* x_m x_m) (+ 0.5 (* x_m (* x_m 0.041666666666666664))))))
       z_m)
      (*
       y_m
       (/
        (/ (* (* x_m x_m) (* (* x_m x_m) 0.041666666666666664)) z_m)
        x_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 200000000000.0) {
		tmp = ((y_m / x_m) * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / z_m;
	} else {
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 200000000000.0d0) then
        tmp = ((y_m / x_m) * (1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * 0.041666666666666664d0)))))) / z_m
    else
        tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664d0)) / z_m) / x_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 200000000000.0) {
		tmp = ((y_m / x_m) * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / z_m;
	} else {
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 200000000000.0:
		tmp = ((y_m / x_m) * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / z_m
	else:
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 200000000000.0)
		tmp = Float64(Float64(Float64(y_m / x_m) * Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * 0.041666666666666664)))))) / z_m);
	else
		tmp = Float64(y_m * Float64(Float64(Float64(Float64(x_m * x_m) * Float64(Float64(x_m * x_m) * 0.041666666666666664)) / z_m) / x_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 200000000000.0)
		tmp = ((y_m / x_m) * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / z_m;
	else
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 200000000000.0], N[(N[(N[(y$95$m / x$95$m), $MachinePrecision] * N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y$95$m * N[(N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 200000000000:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot 0.041666666666666664\right)\right)\right)}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2e11

    1. Initial program 89.1%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6481.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified81.0%

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

    if 2e11 < x

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified86.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \frac{{x}^{4}}{z}\right)}, x\right), y\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{4}}{z}\right), x\right), y\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{\left(2 \cdot 2\right)}}{z}\right), x\right), y\right) \]
      3. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot \left({x}^{2} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot {x}^{2}}{z}\right), x\right), y\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      13. *-lowering-*.f6489.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
    10. Simplified89.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 200000000000:\\ \;\;\;\;\frac{\frac{y}{x} \cdot \left(1 + \left(x \cdot x\right) \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664\right)\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)}{z}}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 88.0% accurate, 4.5× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ \begin{array}{l} t_0 := \left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 200000000000:\\ \;\;\;\;\frac{y\_m}{x\_m} \cdot \frac{1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + t\_0\right)\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{\left(x\_m \cdot x\_m\right) \cdot t\_0}{z\_m}}{x\_m}\\ \end{array}\right)\right) \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (let* ((t_0 (* (* x_m x_m) 0.041666666666666664)))
   (*
    z_s
    (*
     y_s
     (*
      x_s
      (if (<= x_m 200000000000.0)
        (* (/ y_m x_m) (/ (+ 1.0 (* x_m (* x_m (+ 0.5 t_0)))) z_m))
        (* y_m (/ (/ (* (* x_m x_m) t_0) z_m) x_m))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = (x_m * x_m) * 0.041666666666666664;
	double tmp;
	if (x_m <= 200000000000.0) {
		tmp = (y_m / x_m) * ((1.0 + (x_m * (x_m * (0.5 + t_0)))) / z_m);
	} else {
		tmp = y_m * ((((x_m * x_m) * t_0) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x_m * x_m) * 0.041666666666666664d0
    if (x_m <= 200000000000.0d0) then
        tmp = (y_m / x_m) * ((1.0d0 + (x_m * (x_m * (0.5d0 + t_0)))) / z_m)
    else
        tmp = y_m * ((((x_m * x_m) * t_0) / z_m) / x_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double t_0 = (x_m * x_m) * 0.041666666666666664;
	double tmp;
	if (x_m <= 200000000000.0) {
		tmp = (y_m / x_m) * ((1.0 + (x_m * (x_m * (0.5 + t_0)))) / z_m);
	} else {
		tmp = y_m * ((((x_m * x_m) * t_0) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	t_0 = (x_m * x_m) * 0.041666666666666664
	tmp = 0
	if x_m <= 200000000000.0:
		tmp = (y_m / x_m) * ((1.0 + (x_m * (x_m * (0.5 + t_0)))) / z_m)
	else:
		tmp = y_m * ((((x_m * x_m) * t_0) / z_m) / x_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = Float64(Float64(x_m * x_m) * 0.041666666666666664)
	tmp = 0.0
	if (x_m <= 200000000000.0)
		tmp = Float64(Float64(y_m / x_m) * Float64(Float64(1.0 + Float64(x_m * Float64(x_m * Float64(0.5 + t_0)))) / z_m));
	else
		tmp = Float64(y_m * Float64(Float64(Float64(Float64(x_m * x_m) * t_0) / z_m) / x_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	t_0 = (x_m * x_m) * 0.041666666666666664;
	tmp = 0.0;
	if (x_m <= 200000000000.0)
		tmp = (y_m / x_m) * ((1.0 + (x_m * (x_m * (0.5 + t_0)))) / z_m);
	else
		tmp = y_m * ((((x_m * x_m) * t_0) / z_m) / x_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := Block[{t$95$0 = N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]}, N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 200000000000.0], N[(N[(y$95$m / x$95$m), $MachinePrecision] * N[(N[(1.0 + N[(x$95$m * N[(x$95$m * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] * t$95$0), $MachinePrecision] / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
\begin{array}{l}
t_0 := \left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 200000000000:\\
\;\;\;\;\frac{y\_m}{x\_m} \cdot \frac{1 + x\_m \cdot \left(x\_m \cdot \left(0.5 + t\_0\right)\right)}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2e11

    1. Initial program 89.1%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6481.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified81.0%

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

        \[\leadsto \frac{\frac{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right) \cdot y}{x}}{z} \]
      2. associate-/l/N/A

        \[\leadsto \frac{\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right) \cdot y}{\color{blue}{z \cdot x}} \]
      3. times-fracN/A

        \[\leadsto \frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)}{z} \cdot \color{blue}{\frac{y}{x}} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)}{z}\right), \color{blue}{\left(\frac{y}{x}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right), z\right), \left(\frac{\color{blue}{y}}{x}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\left(x \cdot x\right) \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\frac{1}{2} + x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      11. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(x \cdot x\right) \cdot \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right)\right)\right)\right), z\right), \left(\frac{y}{x}\right)\right) \]
      14. /-lowering-/.f6481.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right)\right)\right)\right), z\right), \mathsf{/.f64}\left(y, \color{blue}{x}\right)\right) \]
    7. Applied egg-rr81.4%

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

    if 2e11 < x

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified86.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \frac{{x}^{4}}{z}\right)}, x\right), y\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{4}}{z}\right), x\right), y\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{\left(2 \cdot 2\right)}}{z}\right), x\right), y\right) \]
      3. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot \left({x}^{2} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot {x}^{2}}{z}\right), x\right), y\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      13. *-lowering-*.f6489.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
    10. Simplified89.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 200000000000:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1 + x \cdot \left(x \cdot \left(0.5 + \left(x \cdot x\right) \cdot 0.041666666666666664\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)}{z}}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 87.9% accurate, 5.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 3.75:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + 0.5 \cdot \left(x\_m \cdot x\_m\right)\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{\frac{\left(x\_m \cdot x\_m\right) \cdot \left(\left(x\_m \cdot x\_m\right) \cdot 0.041666666666666664\right)}{z\_m}}{x\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 3.75)
      (/ (* (/ y_m x_m) (+ 1.0 (* 0.5 (* x_m x_m)))) z_m)
      (*
       y_m
       (/
        (/ (* (* x_m x_m) (* (* x_m x_m) 0.041666666666666664)) z_m)
        x_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	} else {
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 3.75d0) then
        tmp = ((y_m / x_m) * (1.0d0 + (0.5d0 * (x_m * x_m)))) / z_m
    else
        tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664d0)) / z_m) / x_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	} else {
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 3.75:
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m
	else:
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 3.75)
		tmp = Float64(Float64(Float64(y_m / x_m) * Float64(1.0 + Float64(0.5 * Float64(x_m * x_m)))) / z_m);
	else
		tmp = Float64(y_m * Float64(Float64(Float64(Float64(x_m * x_m) * Float64(Float64(x_m * x_m) * 0.041666666666666664)) / z_m) / x_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 3.75)
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	else
		tmp = y_m * ((((x_m * x_m) * ((x_m * x_m) * 0.041666666666666664)) / z_m) / x_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 3.75], N[(N[(N[(y$95$m / x$95$m), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y$95$m * N[(N[(N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(N[(x$95$m * x$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3.75:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + 0.5 \cdot \left(x\_m \cdot x\_m\right)\right)}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.75

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {x}^{2}\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left({x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified77.0%

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

    if 3.75 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified85.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \frac{{x}^{4}}{z}\right)}, x\right), y\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{4}}{z}\right), x\right), y\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot {x}^{\left(2 \cdot 2\right)}}{z}\right), x\right), y\right) \]
      3. pow-sqrN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{24} \cdot \left({x}^{2} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot {x}^{2}}{z}\right), x\right), y\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)}{z}\right), x\right), y\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{24} \cdot {x}^{2}\right)\right), z\right), x\right), y\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left({x}^{2} \cdot \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left({x}^{2}\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\left(x \cdot x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
      13. *-lowering-*.f6488.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \frac{1}{24}\right)\right), z\right), x\right), y\right) \]
    10. Simplified88.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.75:\\ \;\;\;\;\frac{\frac{y}{x} \cdot \left(1 + 0.5 \cdot \left(x \cdot x\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\frac{\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 0.041666666666666664\right)}{z}}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 88.1% accurate, 5.6× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \frac{\frac{y\_m \cdot \left(1 + \left(x\_m \cdot x\_m\right) \cdot \left(0.5 + x\_m \cdot \left(x\_m \cdot 0.041666666666666664\right)\right)\right)}{x\_m}}{z\_m}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (/
     (/
      (*
       y_m
       (+ 1.0 (* (* x_m x_m) (+ 0.5 (* x_m (* x_m 0.041666666666666664))))))
      x_m)
     z_m)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	return z_s * (y_s * (x_s * (((y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / x_m) / z_m)));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    code = z_s * (y_s * (x_s * (((y_m * (1.0d0 + ((x_m * x_m) * (0.5d0 + (x_m * (x_m * 0.041666666666666664d0)))))) / x_m) / z_m)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	return z_s * (y_s * (x_s * (((y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / x_m) / z_m)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	return z_s * (y_s * (x_s * (((y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / x_m) / z_m)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	return Float64(z_s * Float64(y_s * Float64(x_s * Float64(Float64(Float64(y_m * Float64(1.0 + Float64(Float64(x_m * x_m) * Float64(0.5 + Float64(x_m * Float64(x_m * 0.041666666666666664)))))) / x_m) / z_m))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = z_s * (y_s * (x_s * (((y_m * (1.0 + ((x_m * x_m) * (0.5 + (x_m * (x_m * 0.041666666666666664)))))) / x_m) / z_m)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * N[(N[(N[(y$95$m * N[(1.0 + N[(N[(x$95$m * x$95$m), $MachinePrecision] * N[(0.5 + N[(x$95$m * N[(x$95$m * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

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

    \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y + {x}^{2} \cdot \left(\frac{1}{24} \cdot \left({x}^{2} \cdot y\right) + \frac{1}{2} \cdot y\right)}{x}\right)}, z\right) \]
  4. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y + {x}^{2} \cdot \left(\frac{1}{24} \cdot \left({x}^{2} \cdot y\right) + \frac{1}{2} \cdot y\right)\right), x\right), z\right) \]
  5. Simplified87.8%

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

Alternative 17: 85.6% accurate, 5.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 3.75:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + 0.5 \cdot \left(x\_m \cdot x\_m\right)\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(y\_m \cdot 0.041666666666666664\right) \cdot \frac{x\_m \cdot \left(x\_m \cdot x\_m\right)}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 3.75)
      (/ (* (/ y_m x_m) (+ 1.0 (* 0.5 (* x_m x_m)))) z_m)
      (* (* y_m 0.041666666666666664) (/ (* x_m (* x_m x_m)) z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 3.75d0) then
        tmp = ((y_m / x_m) * (1.0d0 + (0.5d0 * (x_m * x_m)))) / z_m
    else
        tmp = (y_m * 0.041666666666666664d0) * ((x_m * (x_m * x_m)) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 3.75:
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m
	else:
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 3.75)
		tmp = Float64(Float64(Float64(y_m / x_m) * Float64(1.0 + Float64(0.5 * Float64(x_m * x_m)))) / z_m);
	else
		tmp = Float64(Float64(y_m * 0.041666666666666664) * Float64(Float64(x_m * Float64(x_m * x_m)) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 3.75)
		tmp = ((y_m / x_m) * (1.0 + (0.5 * (x_m * x_m)))) / z_m;
	else
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 3.75], N[(N[(N[(y$95$m / x$95$m), $MachinePrecision] * N[(1.0 + N[(0.5 * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(y$95$m * 0.041666666666666664), $MachinePrecision] * N[(N[(x$95$m * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3.75:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m} \cdot \left(1 + 0.5 \cdot \left(x\_m \cdot x\_m\right)\right)}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.75

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{2} \cdot {x}^{2}\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left({x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f6477.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, x\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified77.0%

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

    if 3.75 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6473.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified73.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \left({x}^{3} \cdot y\right)\right)}, z\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left({x}^{3} \cdot y\right)\right), z\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left(y \cdot {x}^{3}\right)\right), z\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left({x}^{3}\right)\right)\right), z\right) \]
      4. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot \left(x \cdot x\right)\right)\right)\right), z\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot {x}^{2}\right)\right)\right), z\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right)\right), z\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right)\right), z\right) \]
      8. *-lowering-*.f6479.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), z\right) \]
    8. Simplified79.4%

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

        \[\leadsto \frac{\left(\frac{1}{24} \cdot y\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)}{z} \]
      2. associate-/l*N/A

        \[\leadsto \left(\frac{1}{24} \cdot y\right) \cdot \color{blue}{\frac{x \cdot \left(x \cdot x\right)}{z}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{24} \cdot y\right), \color{blue}{\left(\frac{x \cdot \left(x \cdot x\right)}{z}\right)}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(y \cdot \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\left(x \cdot \left(x \cdot x\right)\right), \color{blue}{z}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot x\right)\right), z\right)\right) \]
      8. *-lowering-*.f6482.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), z\right)\right) \]
    10. Applied egg-rr82.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.75:\\ \;\;\;\;\frac{\frac{y}{x} \cdot \left(1 + 0.5 \cdot \left(x \cdot x\right)\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot 0.041666666666666664\right) \cdot \frac{x \cdot \left(x \cdot x\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 66.0% accurate, 6.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 7600:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{elif}\;x\_m \leq 3.7 \cdot 10^{+130}:\\ \;\;\;\;\frac{y\_m \cdot \left(x\_m \cdot 0.5\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{x\_m \cdot 0.5}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 7600.0)
      (/ (/ y_m x_m) z_m)
      (if (<= x_m 3.7e+130)
        (/ (* y_m (* x_m 0.5)) z_m)
        (* y_m (/ (* x_m 0.5) z_m))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 7600.0) {
		tmp = (y_m / x_m) / z_m;
	} else if (x_m <= 3.7e+130) {
		tmp = (y_m * (x_m * 0.5)) / z_m;
	} else {
		tmp = y_m * ((x_m * 0.5) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 7600.0d0) then
        tmp = (y_m / x_m) / z_m
    else if (x_m <= 3.7d+130) then
        tmp = (y_m * (x_m * 0.5d0)) / z_m
    else
        tmp = y_m * ((x_m * 0.5d0) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 7600.0) {
		tmp = (y_m / x_m) / z_m;
	} else if (x_m <= 3.7e+130) {
		tmp = (y_m * (x_m * 0.5)) / z_m;
	} else {
		tmp = y_m * ((x_m * 0.5) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 7600.0:
		tmp = (y_m / x_m) / z_m
	elif x_m <= 3.7e+130:
		tmp = (y_m * (x_m * 0.5)) / z_m
	else:
		tmp = y_m * ((x_m * 0.5) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 7600.0)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	elseif (x_m <= 3.7e+130)
		tmp = Float64(Float64(y_m * Float64(x_m * 0.5)) / z_m);
	else
		tmp = Float64(y_m * Float64(Float64(x_m * 0.5) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 7600.0)
		tmp = (y_m / x_m) / z_m;
	elseif (x_m <= 3.7e+130)
		tmp = (y_m * (x_m * 0.5)) / z_m;
	else
		tmp = y_m * ((x_m * 0.5) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 7600.0], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], If[LessEqual[x$95$m, 3.7e+130], N[(N[(y$95$m * N[(x$95$m * 0.5), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y$95$m * N[(N[(x$95$m * 0.5), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 7600:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

\mathbf{elif}\;x\_m \leq 3.7 \cdot 10^{+130}:\\
\;\;\;\;\frac{y\_m \cdot \left(x\_m \cdot 0.5\right)}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 7600

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified63.7%

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

    if 7600 < x < 3.7000000000000001e130

    1. Initial program 97.3%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      2. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\frac{1}{2} \cdot {x}^{2} + 1\right) \cdot y}{x}\right), z\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + \frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot {x}^{2} + 1\right) \cdot \frac{y}{x}\right), z\right) \]
      6. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      7. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y \cdot 1}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{x}\right), z\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\frac{1}{2} \cdot \left(y \cdot {x}^{2}\right)}{x}\right), z\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot y\right) \cdot {x}^{2}}{x}\right), z\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot y\right) \cdot \left(x \cdot x\right)}{x}\right), z\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot x}{x}\right), z\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot \frac{x}{x}\right), z\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot 1\right), z\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\frac{1}{2} \cdot y\right) \cdot x\right), z\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(y \cdot \frac{1}{2}\right) \cdot x\right), z\right) \]
      19. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + y \cdot \left(\frac{1}{2} \cdot x\right)\right), z\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + y \cdot \left(x \cdot \frac{1}{2}\right)\right), z\right) \]
      21. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \left(\frac{1}{x} + x \cdot \frac{1}{2}\right)\right), z\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{1}{x} + x \cdot \frac{1}{2}\right)\right), z\right) \]
    5. Simplified30.2%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \left(x \cdot y\right)\right)}, z\right) \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot x\right) \cdot y\right), z\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \left(\frac{1}{2} \cdot x\right)\right), z\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{1}{2} \cdot x\right)\right), z\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(x \cdot \frac{1}{2}\right)\right), z\right) \]
      5. *-lowering-*.f6430.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), z\right) \]
    8. Simplified30.2%

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

    if 3.7000000000000001e130 < x

    1. Initial program 78.6%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{\frac{1}{2} \cdot \frac{{x}^{2}}{z} + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{1}{2} \cdot {x}^{2}}{z} + \frac{1}{z}}{x}\right), y\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{{x}^{2} \cdot \frac{1}{2}}{z} + \frac{1}{z}}{x}\right), y\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{2} \cdot \frac{\frac{1}{2}}{z} + \frac{1}{z}}{x}\right), y\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{2} \cdot \frac{\frac{1}{2} \cdot 1}{z} + \frac{1}{z}}{x}\right), y\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right), y\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified96.6%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{x}{z}\right)}, y\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2} \cdot x}{z}\right), y\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot x\right), z\right), y\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot \frac{1}{2}\right), z\right), y\right) \]
      4. *-lowering-*.f6455.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right), z\right), y\right) \]
    10. Simplified55.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7600:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{+130}:\\ \;\;\;\;\frac{y \cdot \left(x \cdot 0.5\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 85.6% accurate, 6.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 3.75:\\ \;\;\;\;\frac{y\_m \cdot \left(\frac{1}{x\_m} + x\_m \cdot 0.5\right)}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(y\_m \cdot 0.041666666666666664\right) \cdot \frac{x\_m \cdot \left(x\_m \cdot x\_m\right)}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 3.75)
      (/ (* y_m (+ (/ 1.0 x_m) (* x_m 0.5))) z_m)
      (* (* y_m 0.041666666666666664) (/ (* x_m (* x_m x_m)) z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = (y_m * ((1.0 / x_m) + (x_m * 0.5))) / z_m;
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 3.75d0) then
        tmp = (y_m * ((1.0d0 / x_m) + (x_m * 0.5d0))) / z_m
    else
        tmp = (y_m * 0.041666666666666664d0) * ((x_m * (x_m * x_m)) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 3.75) {
		tmp = (y_m * ((1.0 / x_m) + (x_m * 0.5))) / z_m;
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 3.75:
		tmp = (y_m * ((1.0 / x_m) + (x_m * 0.5))) / z_m
	else:
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 3.75)
		tmp = Float64(Float64(y_m * Float64(Float64(1.0 / x_m) + Float64(x_m * 0.5))) / z_m);
	else
		tmp = Float64(Float64(y_m * 0.041666666666666664) * Float64(Float64(x_m * Float64(x_m * x_m)) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 3.75)
		tmp = (y_m * ((1.0 / x_m) + (x_m * 0.5))) / z_m;
	else
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 3.75], N[(N[(y$95$m * N[(N[(1.0 / x$95$m), $MachinePrecision] + N[(x$95$m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(y$95$m * 0.041666666666666664), $MachinePrecision] * N[(N[(x$95$m * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 3.75:\\
\;\;\;\;\frac{y\_m \cdot \left(\frac{1}{x\_m} + x\_m \cdot 0.5\right)}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 3.75

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      2. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\frac{1}{2} \cdot {x}^{2} + 1\right) \cdot y}{x}\right), z\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + \frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot {x}^{2} + 1\right) \cdot \frac{y}{x}\right), z\right) \]
      6. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      7. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y \cdot 1}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{x}\right), z\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\frac{1}{2} \cdot \left(y \cdot {x}^{2}\right)}{x}\right), z\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot y\right) \cdot {x}^{2}}{x}\right), z\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot y\right) \cdot \left(x \cdot x\right)}{x}\right), z\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot x}{x}\right), z\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot \frac{x}{x}\right), z\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot 1\right), z\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\frac{1}{2} \cdot y\right) \cdot x\right), z\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(y \cdot \frac{1}{2}\right) \cdot x\right), z\right) \]
      19. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + y \cdot \left(\frac{1}{2} \cdot x\right)\right), z\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + y \cdot \left(x \cdot \frac{1}{2}\right)\right), z\right) \]
      21. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \left(\frac{1}{x} + x \cdot \frac{1}{2}\right)\right), z\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{1}{x} + x \cdot \frac{1}{2}\right)\right), z\right) \]
    5. Simplified75.3%

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

    if 3.75 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6473.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified73.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \left({x}^{3} \cdot y\right)\right)}, z\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left({x}^{3} \cdot y\right)\right), z\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left(y \cdot {x}^{3}\right)\right), z\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left({x}^{3}\right)\right)\right), z\right) \]
      4. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot \left(x \cdot x\right)\right)\right)\right), z\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot {x}^{2}\right)\right)\right), z\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right)\right), z\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right)\right), z\right) \]
      8. *-lowering-*.f6479.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), z\right) \]
    8. Simplified79.4%

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

        \[\leadsto \frac{\left(\frac{1}{24} \cdot y\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)}{z} \]
      2. associate-/l*N/A

        \[\leadsto \left(\frac{1}{24} \cdot y\right) \cdot \color{blue}{\frac{x \cdot \left(x \cdot x\right)}{z}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{24} \cdot y\right), \color{blue}{\left(\frac{x \cdot \left(x \cdot x\right)}{z}\right)}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(y \cdot \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\left(x \cdot \left(x \cdot x\right)\right), \color{blue}{z}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot x\right)\right), z\right)\right) \]
      8. *-lowering-*.f6482.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), z\right)\right) \]
    10. Applied egg-rr82.2%

      \[\leadsto \color{blue}{\left(y \cdot 0.041666666666666664\right) \cdot \frac{x \cdot \left(x \cdot x\right)}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 85.4% accurate, 6.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 2.2:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(y\_m \cdot 0.041666666666666664\right) \cdot \frac{x\_m \cdot \left(x\_m \cdot x\_m\right)}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 2.2)
      (/ (/ y_m x_m) z_m)
      (* (* y_m 0.041666666666666664) (/ (* x_m (* x_m x_m)) z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 2.2) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 2.2d0) then
        tmp = (y_m / x_m) / z_m
    else
        tmp = (y_m * 0.041666666666666664d0) * ((x_m * (x_m * x_m)) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 2.2) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 2.2:
		tmp = (y_m / x_m) / z_m
	else:
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 2.2)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	else
		tmp = Float64(Float64(y_m * 0.041666666666666664) * Float64(Float64(x_m * Float64(x_m * x_m)) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 2.2)
		tmp = (y_m / x_m) / z_m;
	else
		tmp = (y_m * 0.041666666666666664) * ((x_m * (x_m * x_m)) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 2.2], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(N[(y$95$m * 0.041666666666666664), $MachinePrecision] * N[(N[(x$95$m * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.2:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.2000000000000002

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified63.7%

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

    if 2.2000000000000002 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6473.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified73.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \left({x}^{3} \cdot y\right)\right)}, z\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left({x}^{3} \cdot y\right)\right), z\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left(y \cdot {x}^{3}\right)\right), z\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left({x}^{3}\right)\right)\right), z\right) \]
      4. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot \left(x \cdot x\right)\right)\right)\right), z\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot {x}^{2}\right)\right)\right), z\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right)\right), z\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right)\right), z\right) \]
      8. *-lowering-*.f6479.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), z\right) \]
    8. Simplified79.4%

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

        \[\leadsto \frac{\left(\frac{1}{24} \cdot y\right) \cdot \left(x \cdot \left(x \cdot x\right)\right)}{z} \]
      2. associate-/l*N/A

        \[\leadsto \left(\frac{1}{24} \cdot y\right) \cdot \color{blue}{\frac{x \cdot \left(x \cdot x\right)}{z}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{24} \cdot y\right), \color{blue}{\left(\frac{x \cdot \left(x \cdot x\right)}{z}\right)}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(y \cdot \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \left(\frac{\color{blue}{x \cdot \left(x \cdot x\right)}}{z}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\left(x \cdot \left(x \cdot x\right)\right), \color{blue}{z}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot x\right)\right), z\right)\right) \]
      8. *-lowering-*.f6482.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right), z\right)\right) \]
    10. Applied egg-rr82.2%

      \[\leadsto \color{blue}{\left(y \cdot 0.041666666666666664\right) \cdot \frac{x \cdot \left(x \cdot x\right)}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 83.3% accurate, 6.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 2.2:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \left(x\_m \cdot \left(0.041666666666666664 \cdot \frac{x\_m \cdot x\_m}{z\_m}\right)\right)\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 2.2)
      (/ (/ y_m x_m) z_m)
      (* y_m (* x_m (* 0.041666666666666664 (/ (* x_m x_m) z_m)))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 2.2) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = y_m * (x_m * (0.041666666666666664 * ((x_m * x_m) / z_m)));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 2.2d0) then
        tmp = (y_m / x_m) / z_m
    else
        tmp = y_m * (x_m * (0.041666666666666664d0 * ((x_m * x_m) / z_m)))
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 2.2) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = y_m * (x_m * (0.041666666666666664 * ((x_m * x_m) / z_m)));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 2.2:
		tmp = (y_m / x_m) / z_m
	else:
		tmp = y_m * (x_m * (0.041666666666666664 * ((x_m * x_m) / z_m)))
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 2.2)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	else
		tmp = Float64(y_m * Float64(x_m * Float64(0.041666666666666664 * Float64(Float64(x_m * x_m) / z_m))));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 2.2)
		tmp = (y_m / x_m) / z_m;
	else
		tmp = y_m * (x_m * (0.041666666666666664 * ((x_m * x_m) / z_m)));
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 2.2], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y$95$m * N[(x$95$m * N[(0.041666666666666664 * N[(N[(x$95$m * x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.2:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.2000000000000002

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified63.7%

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

    if 2.2000000000000002 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified85.1%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \frac{{x}^{3}}{z}\right)}, y\right) \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{3}}{z} \cdot \frac{1}{24}\right), y\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{3} \cdot \frac{1}{24}}{z}\right), y\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{3} \cdot \frac{\frac{1}{24}}{z}\right), y\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{3} \cdot \frac{\frac{1}{24} \cdot 1}{z}\right), y\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left({x}^{3} \cdot \left(\frac{1}{24} \cdot \frac{1}{z}\right)\right), y\right) \]
      6. cube-multN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\frac{1}{24} \cdot \frac{1}{z}\right)\right), y\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(x \cdot {x}^{2}\right) \cdot \left(\frac{1}{24} \cdot \frac{1}{z}\right)\right), y\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{1}{z}\right)\right)\right), y\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(\left(\frac{1}{24} \cdot \frac{1}{z}\right) \cdot {x}^{2}\right)\right), y\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(\frac{1}{24} \cdot \left(\frac{1}{z} \cdot {x}^{2}\right)\right)\right), y\right) \]
      11. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(\frac{1}{24} \cdot \frac{1 \cdot {x}^{2}}{z}\right)\right), y\right) \]
      12. *-lft-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(x \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z}\right)\right), y\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z}\right)\right), y\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{24}, \left(\frac{{x}^{2}}{z}\right)\right)\right), y\right) \]
      15. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{/.f64}\left(\left({x}^{2}\right), z\right)\right)\right), y\right) \]
      16. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{/.f64}\left(\left(x \cdot x\right), z\right)\right)\right), y\right) \]
      17. *-lowering-*.f6479.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{24}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, x\right), z\right)\right)\right), y\right) \]
    10. Simplified79.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.2:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot \left(0.041666666666666664 \cdot \frac{x \cdot x}{z}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 82.0% accurate, 6.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 2.2:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \frac{0.041666666666666664 \cdot \left(y\_m \cdot \left(x\_m \cdot x\_m\right)\right)}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 2.2)
      (/ (/ y_m x_m) z_m)
      (* x_m (/ (* 0.041666666666666664 (* y_m (* x_m x_m))) z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 2.2) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = x_m * ((0.041666666666666664 * (y_m * (x_m * x_m))) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 2.2d0) then
        tmp = (y_m / x_m) / z_m
    else
        tmp = x_m * ((0.041666666666666664d0 * (y_m * (x_m * x_m))) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 2.2) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = x_m * ((0.041666666666666664 * (y_m * (x_m * x_m))) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 2.2:
		tmp = (y_m / x_m) / z_m
	else:
		tmp = x_m * ((0.041666666666666664 * (y_m * (x_m * x_m))) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 2.2)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	else
		tmp = Float64(x_m * Float64(Float64(0.041666666666666664 * Float64(y_m * Float64(x_m * x_m))) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 2.2)
		tmp = (y_m / x_m) / z_m;
	else
		tmp = x_m * ((0.041666666666666664 * (y_m * (x_m * x_m))) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 2.2], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(x$95$m * N[(N[(0.041666666666666664 * N[(y$95$m * N[(x$95$m * x$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 2.2:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.2000000000000002

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified63.7%

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

    if 2.2000000000000002 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\color{blue}{\left(1 + {x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)}, \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    4. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left({x}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({x}^{2}\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(x \cdot x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \left(\frac{1}{2} + \frac{1}{24} \cdot {x}^{2}\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot {x}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{24} \cdot \left(x \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(\left(\frac{1}{24} \cdot x\right) \cdot x\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot x\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
      11. *-lowering-*.f6473.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{24}\right)\right)\right)\right)\right), \mathsf{/.f64}\left(y, x\right)\right), z\right) \]
    5. Simplified73.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot \left({x}^{3} \cdot y\right)\right)}, z\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left({x}^{3} \cdot y\right)\right), z\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \left(y \cdot {x}^{3}\right)\right), z\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left({x}^{3}\right)\right)\right), z\right) \]
      4. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot \left(x \cdot x\right)\right)\right)\right), z\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \left(x \cdot {x}^{2}\right)\right)\right), z\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left({x}^{2}\right)\right)\right)\right), z\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \left(x \cdot x\right)\right)\right)\right), z\right) \]
      8. *-lowering-*.f6479.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, x\right)\right)\right)\right), z\right) \]
    8. Simplified79.4%

      \[\leadsto \frac{\color{blue}{0.041666666666666664 \cdot \left(y \cdot \left(x \cdot \left(x \cdot x\right)\right)\right)}}{z} \]
    9. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{1}{24} \cdot \frac{{x}^{3} \cdot y}{z}} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{{x}^{3} \cdot y}{z} \cdot \color{blue}{\frac{1}{24}} \]
      2. associate-/l*N/A

        \[\leadsto \left({x}^{3} \cdot \frac{y}{z}\right) \cdot \frac{1}{24} \]
      3. associate-*r*N/A

        \[\leadsto {x}^{3} \cdot \color{blue}{\left(\frac{y}{z} \cdot \frac{1}{24}\right)} \]
      4. *-commutativeN/A

        \[\leadsto {x}^{3} \cdot \left(\frac{1}{24} \cdot \color{blue}{\frac{y}{z}}\right) \]
      5. cube-multN/A

        \[\leadsto \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot \frac{y}{z}\right) \]
      6. unpow2N/A

        \[\leadsto \left(x \cdot {x}^{2}\right) \cdot \left(\frac{1}{24} \cdot \frac{y}{z}\right) \]
      7. associate-*l*N/A

        \[\leadsto x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{y}{z}\right)\right)} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{y}{z}\right)\right)}\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left({x}^{2} \cdot \left(\frac{y}{z} \cdot \color{blue}{\frac{1}{24}}\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left({x}^{2} \cdot \frac{y}{z}\right) \cdot \color{blue}{\frac{1}{24}}\right)\right) \]
      11. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{{x}^{2} \cdot y}{z} \cdot \frac{1}{24}\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot \color{blue}{\frac{{x}^{2} \cdot y}{z}}\right)\right) \]
      13. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{24} \cdot \left({x}^{2} \cdot y\right)}{\color{blue}{z}}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\left(\frac{1}{24} \cdot \left({x}^{2} \cdot y\right)\right), \color{blue}{z}\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\left(\left({x}^{2} \cdot y\right) \cdot \frac{1}{24}\right), z\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({x}^{2} \cdot y\right), \frac{1}{24}\right), z\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(y \cdot {x}^{2}\right), \frac{1}{24}\right), z\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \left({x}^{2}\right)\right), \frac{1}{24}\right), z\right)\right) \]
      19. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \left(x \cdot x\right)\right), \frac{1}{24}\right), z\right)\right) \]
      20. *-lowering-*.f6473.5%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(y, \mathsf{*.f64}\left(x, x\right)\right), \frac{1}{24}\right), z\right)\right) \]
    11. Simplified73.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.2:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{0.041666666666666664 \cdot \left(y \cdot \left(x \cdot x\right)\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 77.8% accurate, 6.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 7600:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(x\_m \cdot \left(x\_m \cdot \frac{y\_m \cdot 0.041666666666666664}{z\_m}\right)\right)\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 7600.0)
      (/ (/ y_m x_m) z_m)
      (* x_m (* x_m (* x_m (/ (* y_m 0.041666666666666664) z_m)))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 7600.0) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = x_m * (x_m * (x_m * ((y_m * 0.041666666666666664) / z_m)));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 7600.0d0) then
        tmp = (y_m / x_m) / z_m
    else
        tmp = x_m * (x_m * (x_m * ((y_m * 0.041666666666666664d0) / z_m)))
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 7600.0) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = x_m * (x_m * (x_m * ((y_m * 0.041666666666666664) / z_m)));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 7600.0:
		tmp = (y_m / x_m) / z_m
	else:
		tmp = x_m * (x_m * (x_m * ((y_m * 0.041666666666666664) / z_m)))
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 7600.0)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	else
		tmp = Float64(x_m * Float64(x_m * Float64(x_m * Float64(Float64(y_m * 0.041666666666666664) / z_m))));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 7600.0)
		tmp = (y_m / x_m) / z_m;
	else
		tmp = x_m * (x_m * (x_m * ((y_m * 0.041666666666666664) / z_m)));
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 7600.0], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(x$95$m * N[(x$95$m * N[(x$95$m * N[(N[(y$95$m * 0.041666666666666664), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 7600:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 7600

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified63.7%

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

    if 7600 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{{x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2}}{z} + \frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified85.1%

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

      \[\leadsto \color{blue}{\frac{1}{24} \cdot \frac{{x}^{3} \cdot y}{z}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{{x}^{3} \cdot y}{z} \cdot \color{blue}{\frac{1}{24}} \]
      2. associate-/l*N/A

        \[\leadsto \left({x}^{3} \cdot \frac{y}{z}\right) \cdot \frac{1}{24} \]
      3. associate-*r*N/A

        \[\leadsto {x}^{3} \cdot \color{blue}{\left(\frac{y}{z} \cdot \frac{1}{24}\right)} \]
      4. *-commutativeN/A

        \[\leadsto {x}^{3} \cdot \left(\frac{1}{24} \cdot \color{blue}{\frac{y}{z}}\right) \]
      5. cube-multN/A

        \[\leadsto \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\color{blue}{\frac{1}{24}} \cdot \frac{y}{z}\right) \]
      6. unpow2N/A

        \[\leadsto \left(x \cdot {x}^{2}\right) \cdot \left(\frac{1}{24} \cdot \frac{y}{z}\right) \]
      7. associate-*l*N/A

        \[\leadsto x \cdot \color{blue}{\left({x}^{2} \cdot \left(\frac{1}{24} \cdot \frac{y}{z}\right)\right)} \]
      8. associate-*r*N/A

        \[\leadsto x \cdot \left(\left({x}^{2} \cdot \frac{1}{24}\right) \cdot \color{blue}{\frac{y}{z}}\right) \]
      9. *-commutativeN/A

        \[\leadsto x \cdot \left(\left(\frac{1}{24} \cdot {x}^{2}\right) \cdot \frac{\color{blue}{y}}{z}\right) \]
      10. associate-*r*N/A

        \[\leadsto x \cdot \left(\frac{1}{24} \cdot \color{blue}{\left({x}^{2} \cdot \frac{y}{z}\right)}\right) \]
      11. associate-/l*N/A

        \[\leadsto x \cdot \left(\frac{1}{24} \cdot \frac{{x}^{2} \cdot y}{\color{blue}{z}}\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{24} \cdot \frac{{x}^{2} \cdot y}{z}\right)}\right) \]
      13. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot \left({x}^{2} \cdot \color{blue}{\frac{y}{z}}\right)\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{1}{24} \cdot \left(\frac{y}{z} \cdot \color{blue}{{x}^{2}}\right)\right)\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{24} \cdot \frac{y}{z}\right) \cdot \color{blue}{{x}^{2}}\right)\right) \]
      16. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\frac{1}{24} \cdot \frac{y}{z}\right) \cdot \left(x \cdot \color{blue}{x}\right)\right)\right) \]
      17. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{24} \cdot \frac{y}{z}\right) \cdot x\right) \cdot \color{blue}{x}\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(\left(\frac{1}{24} \cdot \frac{y}{z}\right) \cdot x\right), \color{blue}{x}\right)\right) \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{24} \cdot \frac{y}{z}\right), x\right), x\right)\right) \]
      20. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{1}{24} \cdot y}{z}\right), x\right), x\right)\right) \]
      21. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{24} \cdot y\right), z\right), x\right), x\right)\right) \]
      22. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{1}{24}\right), z\right), x\right), x\right)\right) \]
      23. *-lowering-*.f6468.9%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \frac{1}{24}\right), z\right), x\right), x\right)\right) \]
    10. Simplified68.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7600:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(x \cdot \left(x \cdot \frac{y \cdot 0.041666666666666664}{z}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 66.1% accurate, 8.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 7600:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;y\_m \cdot \frac{x\_m \cdot 0.5}{z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 7600.0) (/ (/ y_m x_m) z_m) (* y_m (/ (* x_m 0.5) z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 7600.0) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = y_m * ((x_m * 0.5) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 7600.0d0) then
        tmp = (y_m / x_m) / z_m
    else
        tmp = y_m * ((x_m * 0.5d0) / z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 7600.0) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = y_m * ((x_m * 0.5) / z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 7600.0:
		tmp = (y_m / x_m) / z_m
	else:
		tmp = y_m * ((x_m * 0.5) / z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 7600.0)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	else
		tmp = Float64(y_m * Float64(Float64(x_m * 0.5) / z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 7600.0)
		tmp = (y_m / x_m) / z_m;
	else
		tmp = y_m * ((x_m * 0.5) / z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 7600.0], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y$95$m * N[(N[(x$95$m * 0.5), $MachinePrecision] / z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 7600:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 7600

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified63.7%

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

    if 7600 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{y}{x} \cdot \cosh x}{z} \]
      2. associate-/l*N/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{\cosh x}{z}} \]
      3. times-fracN/A

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

        \[\leadsto y \cdot \color{blue}{\frac{\cosh x}{x \cdot z}} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\cosh x}{x \cdot z} \cdot \color{blue}{y} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cosh x}{x \cdot z}\right), \color{blue}{y}\right) \]
      7. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\cosh x}{x}}{z}\right), y\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{\cosh x}{x}\right), z\right), y\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\cosh x, x\right), z\right), y\right) \]
      10. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cosh.f64}\left(x\right), x\right), z\right), y\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{\frac{1}{2} \cdot \frac{{x}^{2}}{z} + \frac{1}{z}}{x}\right)}, y\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{\frac{1}{2} \cdot {x}^{2}}{z} + \frac{1}{z}}{x}\right), y\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{{x}^{2} \cdot \frac{1}{2}}{z} + \frac{1}{z}}{x}\right), y\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{2} \cdot \frac{\frac{1}{2}}{z} + \frac{1}{z}}{x}\right), y\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{2} \cdot \frac{\frac{1}{2} \cdot 1}{z} + \frac{1}{z}}{x}\right), y\right) \]
      5. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{{x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}}{x}\right), y\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({x}^{2} \cdot \left(\frac{1}{2} \cdot \frac{1}{z}\right) + \frac{1}{z}\right), x\right), y\right) \]
    7. Simplified68.9%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot \frac{x}{z}\right)}, y\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2} \cdot x}{z}\right), y\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot x\right), z\right), y\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(x \cdot \frac{1}{2}\right), z\right), y\right) \]
      4. *-lowering-*.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right), z\right), y\right) \]
    10. Simplified38.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7600:\\ \;\;\;\;\frac{\frac{y}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x \cdot 0.5}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 62.0% accurate, 8.9× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 1.42:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \left(y\_m \cdot \frac{0.5}{z\_m}\right)\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (*
    x_s
    (if (<= x_m 1.42) (/ (/ y_m x_m) z_m) (* x_m (* y_m (/ 0.5 z_m))))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 1.42) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = x_m * (y_m * (0.5 / z_m));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (x_m <= 1.42d0) then
        tmp = (y_m / x_m) / z_m
    else
        tmp = x_m * (y_m * (0.5d0 / z_m))
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (x_m <= 1.42) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = x_m * (y_m * (0.5 / z_m));
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if x_m <= 1.42:
		tmp = (y_m / x_m) / z_m
	else:
		tmp = x_m * (y_m * (0.5 / z_m))
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (x_m <= 1.42)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	else
		tmp = Float64(x_m * Float64(y_m * Float64(0.5 / z_m)));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (x_m <= 1.42)
		tmp = (y_m / x_m) / z_m;
	else
		tmp = x_m * (y_m * (0.5 / z_m));
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[x$95$m, 1.42], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(x$95$m * N[(y$95$m * N[(0.5 / z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 1.42:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.4199999999999999

    1. Initial program 88.9%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified63.7%

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

    if 1.4199999999999999 < x

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      2. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\frac{1}{2} \cdot {x}^{2} + 1\right) \cdot y}{x}\right), z\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      4. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + \frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\frac{1}{2} \cdot {x}^{2} + 1\right) \cdot \frac{y}{x}\right), z\right) \]
      6. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      7. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y \cdot 1}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot \frac{y}{x}\right), z\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y}{x}\right), z\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{x}\right), z\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\frac{1}{2} \cdot \left(y \cdot {x}^{2}\right)}{x}\right), z\right) \]
      12. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot y\right) \cdot {x}^{2}}{x}\right), z\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\frac{1}{2} \cdot y\right) \cdot \left(x \cdot x\right)}{x}\right), z\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \frac{\left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot x}{x}\right), z\right) \]
      15. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot \frac{x}{x}\right), z\right) \]
      16. *-inversesN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\left(\frac{1}{2} \cdot y\right) \cdot x\right) \cdot 1\right), z\right) \]
      17. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(\frac{1}{2} \cdot y\right) \cdot x\right), z\right) \]
      18. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + \left(y \cdot \frac{1}{2}\right) \cdot x\right), z\right) \]
      19. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + y \cdot \left(\frac{1}{2} \cdot x\right)\right), z\right) \]
      20. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \frac{1}{x} + y \cdot \left(x \cdot \frac{1}{2}\right)\right), z\right) \]
      21. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(y \cdot \left(\frac{1}{x} + x \cdot \frac{1}{2}\right)\right), z\right) \]
      22. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{1}{x} + x \cdot \frac{1}{2}\right)\right), z\right) \]
    5. Simplified42.6%

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{x \cdot y}{z}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{x \cdot y}{z} \cdot \color{blue}{\frac{1}{2}} \]
      2. associate-/l*N/A

        \[\leadsto \left(x \cdot \frac{y}{z}\right) \cdot \frac{1}{2} \]
      3. associate-*r*N/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} \cdot \frac{1}{2}\right)} \]
      4. *-commutativeN/A

        \[\leadsto x \cdot \left(\frac{1}{2} \cdot \color{blue}{\frac{y}{z}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{2} \cdot \frac{y}{z}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{\frac{1}{2} \cdot y}{\color{blue}{z}}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(\frac{y \cdot \frac{1}{2}}{z}\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(y \cdot \color{blue}{\frac{\frac{1}{2}}{z}}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(y \cdot \frac{\frac{1}{2} \cdot 1}{z}\right)\right) \]
      10. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \left(y \cdot \left(\frac{1}{2} \cdot \color{blue}{\frac{1}{z}}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{z}\right)}\right)\right) \]
      12. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \left(\frac{\frac{1}{2} \cdot 1}{\color{blue}{z}}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \left(\frac{\frac{1}{2}}{z}\right)\right)\right) \]
      14. /-lowering-/.f6432.5%

        \[\leadsto \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{z}\right)\right)\right) \]
    8. Simplified32.5%

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

Alternative 26: 56.4% accurate, 10.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 2.3 \cdot 10^{+106}:\\ \;\;\;\;\frac{\frac{y\_m}{z\_m}}{x\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m}{x\_m \cdot z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (* x_s (if (<= z_m 2.3e+106) (/ (/ y_m z_m) x_m) (/ y_m (* x_m z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 2.3e+106) {
		tmp = (y_m / z_m) / x_m;
	} else {
		tmp = y_m / (x_m * z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (z_m <= 2.3d+106) then
        tmp = (y_m / z_m) / x_m
    else
        tmp = y_m / (x_m * z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 2.3e+106) {
		tmp = (y_m / z_m) / x_m;
	} else {
		tmp = y_m / (x_m * z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if z_m <= 2.3e+106:
		tmp = (y_m / z_m) / x_m
	else:
		tmp = y_m / (x_m * z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (z_m <= 2.3e+106)
		tmp = Float64(Float64(y_m / z_m) / x_m);
	else
		tmp = Float64(y_m / Float64(x_m * z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (z_m <= 2.3e+106)
		tmp = (y_m / z_m) / x_m;
	else
		tmp = y_m / (x_m * z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 2.3e+106], N[(N[(y$95$m / z$95$m), $MachinePrecision] / x$95$m), $MachinePrecision], N[(y$95$m / N[(x$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 2.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{\frac{y\_m}{z\_m}}{x\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.3000000000000002e106

    1. Initial program 88.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

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

        \[\leadsto \frac{\frac{y}{z}}{\color{blue}{x}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{z}\right), \color{blue}{x}\right) \]
      3. /-lowering-/.f6454.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, z\right), x\right) \]
    5. Simplified54.9%

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

    if 2.3000000000000002e106 < z

    1. Initial program 92.0%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6450.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified50.8%

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot z\right)}\right) \]
      3. *-lowering-*.f6450.7%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{z}\right)\right) \]
    7. Applied egg-rr50.7%

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

Alternative 27: 52.6% accurate, 10.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l} \mathbf{if}\;z\_m \leq 1.9 \cdot 10^{-78}:\\ \;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m}{x\_m \cdot z\_m}\\ \end{array}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (*
  z_s
  (*
   y_s
   (* x_s (if (<= z_m 1.9e-78) (/ (/ y_m x_m) z_m) (/ y_m (* x_m z_m)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 1.9e-78) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = y_m / (x_m * z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    real(8) :: tmp
    if (z_m <= 1.9d-78) then
        tmp = (y_m / x_m) / z_m
    else
        tmp = y_m / (x_m * z_m)
    end if
    code = z_s * (y_s * (x_s * tmp))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	double tmp;
	if (z_m <= 1.9e-78) {
		tmp = (y_m / x_m) / z_m;
	} else {
		tmp = y_m / (x_m * z_m);
	}
	return z_s * (y_s * (x_s * tmp));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	tmp = 0
	if z_m <= 1.9e-78:
		tmp = (y_m / x_m) / z_m
	else:
		tmp = y_m / (x_m * z_m)
	return z_s * (y_s * (x_s * tmp))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0
	if (z_m <= 1.9e-78)
		tmp = Float64(Float64(y_m / x_m) / z_m);
	else
		tmp = Float64(y_m / Float64(x_m * z_m));
	end
	return Float64(z_s * Float64(y_s * Float64(x_s * tmp)))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp_2 = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = 0.0;
	if (z_m <= 1.9e-78)
		tmp = (y_m / x_m) / z_m;
	else
		tmp = y_m / (x_m * z_m);
	end
	tmp_2 = z_s * (y_s * (x_s * tmp));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * If[LessEqual[z$95$m, 1.9e-78], N[(N[(y$95$m / x$95$m), $MachinePrecision] / z$95$m), $MachinePrecision], N[(y$95$m / N[(x$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \begin{array}{l}
\mathbf{if}\;z\_m \leq 1.9 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{y\_m}{x\_m}}{z\_m}\\

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


\end{array}\right)\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.8999999999999999e-78

    1. Initial program 89.2%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6450.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified50.8%

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

    if 1.8999999999999999e-78 < z

    1. Initial program 88.5%

      \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f6445.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
    5. Simplified45.9%

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot z\right)}\right) \]
      3. *-lowering-*.f6445.8%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{z}\right)\right) \]
    7. Applied egg-rr45.8%

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

Alternative 28: 49.3% accurate, 21.4× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ z\_m = \left|z\right| \\ z\_s = \mathsf{copysign}\left(1, z\right) \\ z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \frac{y\_m}{x\_m \cdot z\_m}\right)\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
z\_m = (fabs.f64 z)
z\_s = (copysign.f64 #s(literal 1 binary64) z)
(FPCore (z_s y_s x_s x_m y_m z_m)
 :precision binary64
 (* z_s (* y_s (* x_s (/ y_m (* x_m z_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
y\_m = fabs(y);
y\_s = copysign(1.0, y);
z\_m = fabs(z);
z\_s = copysign(1.0, z);
double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	return z_s * (y_s * (x_s * (y_m / (x_m * z_m))));
}
x\_m = abs(x)
x\_s = copysign(1.0d0, x)
y\_m = abs(y)
y\_s = copysign(1.0d0, y)
z\_m = abs(z)
z\_s = copysign(1.0d0, z)
real(8) function code(z_s, y_s, x_s, x_m, y_m, z_m)
    real(8), intent (in) :: z_s
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z_m
    code = z_s * (y_s * (x_s * (y_m / (x_m * z_m))))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
z\_m = Math.abs(z);
z\_s = Math.copySign(1.0, z);
public static double code(double z_s, double y_s, double x_s, double x_m, double y_m, double z_m) {
	return z_s * (y_s * (x_s * (y_m / (x_m * z_m))));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
z\_m = math.fabs(z)
z\_s = math.copysign(1.0, z)
def code(z_s, y_s, x_s, x_m, y_m, z_m):
	return z_s * (y_s * (x_s * (y_m / (x_m * z_m))))
x\_m = abs(x)
x\_s = copysign(1.0, x)
y\_m = abs(y)
y\_s = copysign(1.0, y)
z\_m = abs(z)
z\_s = copysign(1.0, z)
function code(z_s, y_s, x_s, x_m, y_m, z_m)
	return Float64(z_s * Float64(y_s * Float64(x_s * Float64(y_m / Float64(x_m * z_m)))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
z\_m = abs(z);
z\_s = sign(z) * abs(1.0);
function tmp = code(z_s, y_s, x_s, x_m, y_m, z_m)
	tmp = z_s * (y_s * (x_s * (y_m / (x_m * z_m))));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
z\_m = N[Abs[z], $MachinePrecision]
z\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[z$95$s_, y$95$s_, x$95$s_, x$95$m_, y$95$m_, z$95$m_] := N[(z$95$s * N[(y$95$s * N[(x$95$s * N[(y$95$m / N[(x$95$m * z$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)
\\
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)
\\
z\_m = \left|z\right|
\\
z\_s = \mathsf{copysign}\left(1, z\right)

\\
z\_s \cdot \left(y\_s \cdot \left(x\_s \cdot \frac{y\_m}{x\_m \cdot z\_m}\right)\right)
\end{array}
Derivation
  1. Initial program 89.0%

    \[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0

    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{x}\right)}, z\right) \]
  4. Step-by-step derivation
    1. /-lowering-/.f6449.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), z\right) \]
  5. Simplified49.5%

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

      \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot z\right)}\right) \]
    3. *-lowering-*.f6447.3%

      \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{z}\right)\right) \]
  7. Applied egg-rr47.3%

    \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
  8. Add Preprocessing

Developer Target 1: 97.2% accurate, 0.9× 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 2024161 
(FPCore (x y z)
  :name "Linear.Quaternion:$ctan from linear-1.19.1.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y -2309451133843521/5000000000000000000000000000000000000000000000000000000000000000000) (* (/ (/ y z) x) (cosh x)) (if (< y 1038530535935153/1000000000000000000000000000000000000000000000000000000) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x)))))

  (/ (* (cosh x) (/ y x)) z))