Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 85.1% → 99.0%
Time: 4.5s
Alternatives: 9
Speedup: 0.5×

Specification

?
\[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
(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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    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]
\frac{\cosh x \cdot \frac{y}{x}}{z}

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 9 alternatives:

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

Initial Program: 85.1% accurate, 1.0× speedup?

\[\frac{\cosh x \cdot \frac{y}{x}}{z} \]
(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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    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]
\frac{\cosh x \cdot \frac{y}{x}}{z}

Alternative 1: 99.0% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \cosh \left(\left|x\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{t\_0 \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\ \;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|}} \cdot \frac{1}{\left|z\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left|y\right| \cdot t\_0}{\left|z\right|}}{\left|x\right|}\\ \end{array}\right)\right) \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (cosh (fabs x))))
  (*
   (copysign 1.0 x)
   (*
    (copysign 1.0 y)
    (*
     (copysign 1.0 z)
     (if (<= (/ (* t_0 (/ (fabs y) (fabs x))) (fabs z)) 2e-102)
       (* (/ 1.0 (/ (fabs x) (fabs y))) (/ 1.0 (fabs z)))
       (/ (/ (* (fabs y) t_0) (fabs z)) (fabs x))))))))
double code(double x, double y, double z) {
	double t_0 = cosh(fabs(x));
	double tmp;
	if (((t_0 * (fabs(y) / fabs(x))) / fabs(z)) <= 2e-102) {
		tmp = (1.0 / (fabs(x) / fabs(y))) * (1.0 / fabs(z));
	} else {
		tmp = ((fabs(y) * t_0) / fabs(z)) / fabs(x);
	}
	return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
	double t_0 = Math.cosh(Math.abs(x));
	double tmp;
	if (((t_0 * (Math.abs(y) / Math.abs(x))) / Math.abs(z)) <= 2e-102) {
		tmp = (1.0 / (Math.abs(x) / Math.abs(y))) * (1.0 / Math.abs(z));
	} else {
		tmp = ((Math.abs(y) * t_0) / Math.abs(z)) / Math.abs(x);
	}
	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z):
	t_0 = math.cosh(math.fabs(x))
	tmp = 0
	if ((t_0 * (math.fabs(y) / math.fabs(x))) / math.fabs(z)) <= 2e-102:
		tmp = (1.0 / (math.fabs(x) / math.fabs(y))) * (1.0 / math.fabs(z))
	else:
		tmp = ((math.fabs(y) * t_0) / math.fabs(z)) / math.fabs(x)
	return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z)
	t_0 = cosh(abs(x))
	tmp = 0.0
	if (Float64(Float64(t_0 * Float64(abs(y) / abs(x))) / abs(z)) <= 2e-102)
		tmp = Float64(Float64(1.0 / Float64(abs(x) / abs(y))) * Float64(1.0 / abs(z)));
	else
		tmp = Float64(Float64(Float64(abs(y) * t_0) / abs(z)) / abs(x));
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp)))
end
function tmp_2 = code(x, y, z)
	t_0 = cosh(abs(x));
	tmp = 0.0;
	if (((t_0 * (abs(y) / abs(x))) / abs(z)) <= 2e-102)
		tmp = (1.0 / (abs(x) / abs(y))) * (1.0 / abs(z));
	else
		tmp = ((abs(y) * t_0) / abs(z)) / abs(x);
	end
	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp));
end
code[x_, y_, z_] := Block[{t$95$0 = N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(t$95$0 * N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 2e-102], N[(N[(1.0 / N[(N[Abs[x], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Abs[y], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \cosh \left(\left|x\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_0 \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|}} \cdot \frac{1}{\left|z\right|}\\

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


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

    1. Initial program 85.1%

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

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
    4. Applied rewrites49.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
      2. lift-*.f64N/A

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

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{z}} \]
      4. mult-flipN/A

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1}{z}} \]
      5. lift-/.f64N/A

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

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1}{z}} \]
      7. lower-/.f6449.5%

        \[\leadsto \frac{y}{x} \cdot \frac{\color{blue}{1}}{z} \]
    6. Applied rewrites49.5%

      \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1}{z}} \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{y}{x} \cdot \frac{\color{blue}{1}}{z} \]
      2. div-flipN/A

        \[\leadsto \frac{1}{\frac{x}{y}} \cdot \frac{\color{blue}{1}}{z} \]
      3. lower-unsound-/.f64N/A

        \[\leadsto \frac{1}{\frac{x}{y}} \cdot \frac{\color{blue}{1}}{z} \]
      4. lower-unsound-/.f6449.4%

        \[\leadsto \frac{1}{\frac{x}{y}} \cdot \frac{1}{z} \]
    8. Applied rewrites49.4%

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

    if 1.9999999999999999e-102 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 85.1%

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

        \[\leadsto \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
      2. mult-flipN/A

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

        \[\leadsto \color{blue}{\left(\cosh x \cdot \frac{y}{x}\right)} \cdot \frac{1}{z} \]
      4. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
      8. mult-flip-revN/A

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

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

        \[\leadsto \frac{\frac{\color{blue}{y \cdot \cosh x}}{z}}{x} \]
      11. lower-*.f6496.2%

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

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

Alternative 2: 92.3% accurate, 0.5× speedup?

\[\begin{array}{l} t_0 := \frac{\cosh x \cdot \frac{y}{x}}{z}\\ \mathbf{if}\;t\_0 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{\cosh x}{z \cdot x}\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (/ (* (cosh x) (/ y x)) z)))
  (if (<= t_0 INFINITY) t_0 (* y (/ (cosh x) (* z x))))))
double code(double x, double y, double z) {
	double t_0 = (cosh(x) * (y / x)) / z;
	double tmp;
	if (t_0 <= ((double) INFINITY)) {
		tmp = t_0;
	} else {
		tmp = y * (cosh(x) / (z * x));
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = (Math.cosh(x) * (y / x)) / z;
	double tmp;
	if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = t_0;
	} else {
		tmp = y * (Math.cosh(x) / (z * x));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (math.cosh(x) * (y / x)) / z
	tmp = 0
	if t_0 <= math.inf:
		tmp = t_0
	else:
		tmp = y * (math.cosh(x) / (z * x))
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(cosh(x) * Float64(y / x)) / z)
	tmp = 0.0
	if (t_0 <= Inf)
		tmp = t_0;
	else
		tmp = Float64(y * Float64(cosh(x) / Float64(z * x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (cosh(x) * (y / x)) / z;
	tmp = 0.0;
	if (t_0 <= Inf)
		tmp = t_0;
	else
		tmp = y * (cosh(x) / (z * x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(y * N[(N[Cosh[x], $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \frac{\cosh x \cdot \frac{y}{x}}{z}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 85.1%

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

    if +inf.0 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\cosh x}{\color{blue}{z \cdot x}} \]
      11. lower-*.f6483.3%

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

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

Alternative 3: 86.4% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \cosh \left(\left|x\right|\right)\\ t_1 := \frac{\left|y\right|}{\left|x\right|}\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{t\_0 \cdot t\_1}{\left|z\right|} \leq 10^{+296}:\\ \;\;\;\;\frac{t\_1}{\left|z\right|}\\ \mathbf{else}:\\ \;\;\;\;\left|y\right| \cdot \frac{t\_0}{\left|z\right| \cdot \left|x\right|}\\ \end{array}\right)\right) \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (cosh (fabs x))) (t_1 (/ (fabs y) (fabs x))))
  (*
   (copysign 1.0 x)
   (*
    (copysign 1.0 y)
    (*
     (copysign 1.0 z)
     (if (<= (/ (* t_0 t_1) (fabs z)) 1e+296)
       (/ t_1 (fabs z))
       (* (fabs y) (/ t_0 (* (fabs z) (fabs x))))))))))
double code(double x, double y, double z) {
	double t_0 = cosh(fabs(x));
	double t_1 = fabs(y) / fabs(x);
	double tmp;
	if (((t_0 * t_1) / fabs(z)) <= 1e+296) {
		tmp = t_1 / fabs(z);
	} else {
		tmp = fabs(y) * (t_0 / (fabs(z) * fabs(x)));
	}
	return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
	double t_0 = Math.cosh(Math.abs(x));
	double t_1 = Math.abs(y) / Math.abs(x);
	double tmp;
	if (((t_0 * t_1) / Math.abs(z)) <= 1e+296) {
		tmp = t_1 / Math.abs(z);
	} else {
		tmp = Math.abs(y) * (t_0 / (Math.abs(z) * Math.abs(x)));
	}
	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z):
	t_0 = math.cosh(math.fabs(x))
	t_1 = math.fabs(y) / math.fabs(x)
	tmp = 0
	if ((t_0 * t_1) / math.fabs(z)) <= 1e+296:
		tmp = t_1 / math.fabs(z)
	else:
		tmp = math.fabs(y) * (t_0 / (math.fabs(z) * math.fabs(x)))
	return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z)
	t_0 = cosh(abs(x))
	t_1 = Float64(abs(y) / abs(x))
	tmp = 0.0
	if (Float64(Float64(t_0 * t_1) / abs(z)) <= 1e+296)
		tmp = Float64(t_1 / abs(z));
	else
		tmp = Float64(abs(y) * Float64(t_0 / Float64(abs(z) * abs(x))));
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp)))
end
function tmp_2 = code(x, y, z)
	t_0 = cosh(abs(x));
	t_1 = abs(y) / abs(x);
	tmp = 0.0;
	if (((t_0 * t_1) / abs(z)) <= 1e+296)
		tmp = t_1 / abs(z);
	else
		tmp = abs(y) * (t_0 / (abs(z) * abs(x)));
	end
	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp));
end
code[x_, y_, z_] := Block[{t$95$0 = N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(t$95$0 * t$95$1), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 1e+296], N[(t$95$1 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[Abs[y], $MachinePrecision] * N[(t$95$0 / N[(N[Abs[z], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \cosh \left(\left|x\right|\right)\\
t_1 := \frac{\left|y\right|}{\left|x\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{t\_0 \cdot t\_1}{\left|z\right|} \leq 10^{+296}:\\
\;\;\;\;\frac{t\_1}{\left|z\right|}\\

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


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

    1. Initial program 85.1%

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

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
    4. Applied rewrites49.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{z}} \]
      5. lower-/.f6449.5%

        \[\leadsto \frac{\frac{y}{x}}{z} \]
    6. Applied rewrites49.5%

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

    if 9.9999999999999998e295 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\cosh x}{\color{blue}{z \cdot x}} \]
      11. lower-*.f6483.3%

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

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

Alternative 4: 59.6% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \frac{\left|y\right|}{\left|x\right|}\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 10^{+296}:\\ \;\;\;\;\frac{t\_0}{\left|z\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 \cdot \left|z\right| + \left|z\right| \cdot 0}{\left|z\right| \cdot \left|z\right|}}{\left|x\right|} \cdot \left|y\right|\\ \end{array}\right)\right) \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0 (/ (fabs y) (fabs x))))
  (*
   (copysign 1.0 x)
   (*
    (copysign 1.0 y)
    (*
     (copysign 1.0 z)
     (if (<= (/ (* (cosh (fabs x)) t_0) (fabs z)) 1e+296)
       (/ t_0 (fabs z))
       (*
        (/
         (/
          (+ (* 1.0 (fabs z)) (* (fabs z) 0.0))
          (* (fabs z) (fabs z)))
         (fabs x))
        (fabs y))))))))
double code(double x, double y, double z) {
	double t_0 = fabs(y) / fabs(x);
	double tmp;
	if (((cosh(fabs(x)) * t_0) / fabs(z)) <= 1e+296) {
		tmp = t_0 / fabs(z);
	} else {
		tmp = ((((1.0 * fabs(z)) + (fabs(z) * 0.0)) / (fabs(z) * fabs(z))) / fabs(x)) * fabs(y);
	}
	return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
}
public static double code(double x, double y, double z) {
	double t_0 = Math.abs(y) / Math.abs(x);
	double tmp;
	if (((Math.cosh(Math.abs(x)) * t_0) / Math.abs(z)) <= 1e+296) {
		tmp = t_0 / Math.abs(z);
	} else {
		tmp = ((((1.0 * Math.abs(z)) + (Math.abs(z) * 0.0)) / (Math.abs(z) * Math.abs(z))) / Math.abs(x)) * Math.abs(y);
	}
	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
}
def code(x, y, z):
	t_0 = math.fabs(y) / math.fabs(x)
	tmp = 0
	if ((math.cosh(math.fabs(x)) * t_0) / math.fabs(z)) <= 1e+296:
		tmp = t_0 / math.fabs(z)
	else:
		tmp = ((((1.0 * math.fabs(z)) + (math.fabs(z) * 0.0)) / (math.fabs(z) * math.fabs(z))) / math.fabs(x)) * math.fabs(y)
	return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
function code(x, y, z)
	t_0 = Float64(abs(y) / abs(x))
	tmp = 0.0
	if (Float64(Float64(cosh(abs(x)) * t_0) / abs(z)) <= 1e+296)
		tmp = Float64(t_0 / abs(z));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(1.0 * abs(z)) + Float64(abs(z) * 0.0)) / Float64(abs(z) * abs(z))) / abs(x)) * abs(y));
	end
	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp)))
end
function tmp_2 = code(x, y, z)
	t_0 = abs(y) / abs(x);
	tmp = 0.0;
	if (((cosh(abs(x)) * t_0) / abs(z)) <= 1e+296)
		tmp = t_0 / abs(z);
	else
		tmp = ((((1.0 * abs(z)) + (abs(z) * 0.0)) / (abs(z) * abs(z))) / abs(x)) * abs(y);
	end
	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp));
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 1e+296], N[(t$95$0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(1.0 * N[Abs[z], $MachinePrecision]), $MachinePrecision] + N[(N[Abs[z], $MachinePrecision] * 0.0), $MachinePrecision]), $MachinePrecision] / N[(N[Abs[z], $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[y], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{\left|y\right|}{\left|x\right|}\\
\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 10^{+296}:\\
\;\;\;\;\frac{t\_0}{\left|z\right|}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 \cdot \left|z\right| + \left|z\right| \cdot 0}{\left|z\right| \cdot \left|z\right|}}{\left|x\right|} \cdot \left|y\right|\\


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

    1. Initial program 85.1%

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

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
    4. Applied rewrites49.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
      2. lift-*.f64N/A

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

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

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{z}} \]
      5. lower-/.f6449.5%

        \[\leadsto \frac{\frac{y}{x}}{z} \]
    6. Applied rewrites49.5%

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

    if 9.9999999999999998e295 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 85.1%

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

        \[\leadsto \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
      2. mult-flipN/A

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

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

        \[\leadsto \frac{1}{z} \cdot \color{blue}{\left(\cosh x \cdot \frac{y}{x}\right)} \]
      5. lift-cosh.f64N/A

        \[\leadsto \frac{1}{z} \cdot \left(\color{blue}{\cosh x} \cdot \frac{y}{x}\right) \]
      6. cosh-defN/A

        \[\leadsto \frac{1}{z} \cdot \left(\color{blue}{\frac{e^{x} + e^{\mathsf{neg}\left(x\right)}}{2}} \cdot \frac{y}{x}\right) \]
      7. lift-/.f64N/A

        \[\leadsto \frac{1}{z} \cdot \left(\frac{e^{x} + e^{\mathsf{neg}\left(x\right)}}{2} \cdot \color{blue}{\frac{y}{x}}\right) \]
      8. frac-timesN/A

        \[\leadsto \frac{1}{z} \cdot \color{blue}{\frac{\left(e^{x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot y}{2 \cdot x}} \]
      9. associate-*r/N/A

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

        \[\leadsto \frac{\frac{1}{z} \cdot \left(\left(e^{x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot y\right)}{\color{blue}{x \cdot 2}} \]
      11. times-fracN/A

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

        \[\leadsto \frac{\frac{1}{z}}{x} \cdot \color{blue}{\left(\frac{e^{x} + e^{\mathsf{neg}\left(x\right)}}{2} \cdot y\right)} \]
      13. cosh-defN/A

        \[\leadsto \frac{\frac{1}{z}}{x} \cdot \left(\color{blue}{\cosh x} \cdot y\right) \]
      14. lift-cosh.f64N/A

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

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{x} \cdot \left(\cosh x \cdot y\right)} \]
      16. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{z}}{x}} \cdot \left(\cosh x \cdot y\right) \]
      17. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{1}{z}}}{x} \cdot \left(\cosh x \cdot y\right) \]
      18. *-commutativeN/A

        \[\leadsto \frac{\frac{1}{z}}{x} \cdot \color{blue}{\left(y \cdot \cosh x\right)} \]
      19. lower-*.f6484.4%

        \[\leadsto \frac{\frac{1}{z}}{x} \cdot \color{blue}{\left(y \cdot \cosh x\right)} \]
    3. Applied rewrites84.4%

      \[\leadsto \color{blue}{\frac{\frac{1}{z}}{x} \cdot \left(y \cdot \cosh x\right)} \]
    4. Taylor expanded in x around 0

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

        \[\leadsto \frac{\frac{1}{z}}{x} \cdot \color{blue}{y} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{1}{z}}}{x} \cdot y \]
        2. metadata-evalN/A

          \[\leadsto \frac{\frac{\color{blue}{1 + 0}}{z}}{x} \cdot y \]
        3. div-addN/A

          \[\leadsto \frac{\color{blue}{\frac{1}{z} + \frac{0}{z}}}{x} \cdot y \]
        4. frac-addN/A

          \[\leadsto \frac{\color{blue}{\frac{1 \cdot z + z \cdot 0}{z \cdot z}}}{x} \cdot y \]
        5. lower-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{1 \cdot z + z \cdot 0}{z \cdot z}}}{x} \cdot y \]
        6. lower-+.f64N/A

          \[\leadsto \frac{\frac{\color{blue}{1 \cdot z + z \cdot 0}}{z \cdot z}}{x} \cdot y \]
        7. lower-*.f64N/A

          \[\leadsto \frac{\frac{\color{blue}{1 \cdot z} + z \cdot 0}{z \cdot z}}{x} \cdot y \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\frac{1 \cdot z + \color{blue}{z \cdot 0}}{z \cdot z}}{x} \cdot y \]
        9. lower-*.f6447.0%

          \[\leadsto \frac{\frac{1 \cdot z + z \cdot 0}{\color{blue}{z \cdot z}}}{x} \cdot y \]
      3. Applied rewrites47.0%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot z + z \cdot 0}{z \cdot z}}}{x} \cdot y \]
    6. Recombined 2 regimes into one program.
    7. Add Preprocessing

    Alternative 5: 57.2% accurate, 0.3× speedup?

    \[\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\ \;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|}} \cdot \frac{1}{\left|z\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\ \end{array}\right)\right) \]
    (FPCore (x y z)
      :precision binary64
      (*
     (copysign 1.0 x)
     (*
      (copysign 1.0 y)
      (*
       (copysign 1.0 z)
       (if (<=
            (/ (* (cosh (fabs x)) (/ (fabs y) (fabs x))) (fabs z))
            2e-102)
         (* (/ 1.0 (/ (fabs x) (fabs y))) (/ 1.0 (fabs z)))
         (/ (/ (fabs y) (fabs z)) (fabs x)))))))
    double code(double x, double y, double z) {
    	double tmp;
    	if (((cosh(fabs(x)) * (fabs(y) / fabs(x))) / fabs(z)) <= 2e-102) {
    		tmp = (1.0 / (fabs(x) / fabs(y))) * (1.0 / fabs(z));
    	} else {
    		tmp = (fabs(y) / fabs(z)) / fabs(x);
    	}
    	return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
    }
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (((Math.cosh(Math.abs(x)) * (Math.abs(y) / Math.abs(x))) / Math.abs(z)) <= 2e-102) {
    		tmp = (1.0 / (Math.abs(x) / Math.abs(y))) * (1.0 / Math.abs(z));
    	} else {
    		tmp = (Math.abs(y) / Math.abs(z)) / Math.abs(x);
    	}
    	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
    }
    
    def code(x, y, z):
    	tmp = 0
    	if ((math.cosh(math.fabs(x)) * (math.fabs(y) / math.fabs(x))) / math.fabs(z)) <= 2e-102:
    		tmp = (1.0 / (math.fabs(x) / math.fabs(y))) * (1.0 / math.fabs(z))
    	else:
    		tmp = (math.fabs(y) / math.fabs(z)) / math.fabs(x)
    	return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
    
    function code(x, y, z)
    	tmp = 0.0
    	if (Float64(Float64(cosh(abs(x)) * Float64(abs(y) / abs(x))) / abs(z)) <= 2e-102)
    		tmp = Float64(Float64(1.0 / Float64(abs(x) / abs(y))) * Float64(1.0 / abs(z)));
    	else
    		tmp = Float64(Float64(abs(y) / abs(z)) / abs(x));
    	end
    	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp)))
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (((cosh(abs(x)) * (abs(y) / abs(x))) / abs(z)) <= 2e-102)
    		tmp = (1.0 / (abs(x) / abs(y))) * (1.0 / abs(z));
    	else
    		tmp = (abs(y) / abs(z)) / abs(x);
    	end
    	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp));
    end
    
    code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 2e-102], N[(N[(1.0 / N[(N[Abs[x], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
    \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\
    \;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|}} \cdot \frac{1}{\left|z\right|}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\
    
    
    \end{array}\right)\right)
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.9999999999999999e-102

      1. Initial program 85.1%

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

        \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
      4. Applied rewrites49.4%

        \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
        2. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{z}} \]
        4. mult-flipN/A

          \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1}{z}} \]
        5. lift-/.f64N/A

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

          \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1}{z}} \]
        7. lower-/.f6449.5%

          \[\leadsto \frac{y}{x} \cdot \frac{\color{blue}{1}}{z} \]
      6. Applied rewrites49.5%

        \[\leadsto \frac{y}{x} \cdot \color{blue}{\frac{1}{z}} \]
      7. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \frac{y}{x} \cdot \frac{\color{blue}{1}}{z} \]
        2. div-flipN/A

          \[\leadsto \frac{1}{\frac{x}{y}} \cdot \frac{\color{blue}{1}}{z} \]
        3. lower-unsound-/.f64N/A

          \[\leadsto \frac{1}{\frac{x}{y}} \cdot \frac{\color{blue}{1}}{z} \]
        4. lower-unsound-/.f6449.4%

          \[\leadsto \frac{1}{\frac{x}{y}} \cdot \frac{1}{z} \]
      8. Applied rewrites49.4%

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

      if 1.9999999999999999e-102 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

      1. Initial program 85.1%

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

          \[\leadsto \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
        2. mult-flipN/A

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

          \[\leadsto \color{blue}{\left(\cosh x \cdot \frac{y}{x}\right)} \cdot \frac{1}{z} \]
        4. lift-/.f64N/A

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

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

          \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
        7. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
        8. mult-flip-revN/A

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

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

          \[\leadsto \frac{\frac{\color{blue}{y \cdot \cosh x}}{z}}{x} \]
        11. lower-*.f6496.2%

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

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

        \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
      5. Step-by-step derivation
        1. Applied rewrites53.6%

          \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
      6. Recombined 2 regimes into one program.
      7. Add Preprocessing

      Alternative 6: 56.7% accurate, 0.3× speedup?

      \[\begin{array}{l} t_0 := \frac{\left|y\right|}{\left|x\right|}\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 4 \cdot 10^{+173}:\\ \;\;\;\;\frac{t\_0}{\left|z\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\ \end{array}\right)\right) \end{array} \]
      (FPCore (x y z)
        :precision binary64
        (let* ((t_0 (/ (fabs y) (fabs x))))
        (*
         (copysign 1.0 x)
         (*
          (copysign 1.0 y)
          (*
           (copysign 1.0 z)
           (if (<= (/ (* (cosh (fabs x)) t_0) (fabs z)) 4e+173)
             (/ t_0 (fabs z))
             (/ (/ (fabs y) (fabs z)) (fabs x))))))))
      double code(double x, double y, double z) {
      	double t_0 = fabs(y) / fabs(x);
      	double tmp;
      	if (((cosh(fabs(x)) * t_0) / fabs(z)) <= 4e+173) {
      		tmp = t_0 / fabs(z);
      	} else {
      		tmp = (fabs(y) / fabs(z)) / fabs(x);
      	}
      	return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
      }
      
      public static double code(double x, double y, double z) {
      	double t_0 = Math.abs(y) / Math.abs(x);
      	double tmp;
      	if (((Math.cosh(Math.abs(x)) * t_0) / Math.abs(z)) <= 4e+173) {
      		tmp = t_0 / Math.abs(z);
      	} else {
      		tmp = (Math.abs(y) / Math.abs(z)) / Math.abs(x);
      	}
      	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
      }
      
      def code(x, y, z):
      	t_0 = math.fabs(y) / math.fabs(x)
      	tmp = 0
      	if ((math.cosh(math.fabs(x)) * t_0) / math.fabs(z)) <= 4e+173:
      		tmp = t_0 / math.fabs(z)
      	else:
      		tmp = (math.fabs(y) / math.fabs(z)) / math.fabs(x)
      	return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
      
      function code(x, y, z)
      	t_0 = Float64(abs(y) / abs(x))
      	tmp = 0.0
      	if (Float64(Float64(cosh(abs(x)) * t_0) / abs(z)) <= 4e+173)
      		tmp = Float64(t_0 / abs(z));
      	else
      		tmp = Float64(Float64(abs(y) / abs(z)) / abs(x));
      	end
      	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp)))
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = abs(y) / abs(x);
      	tmp = 0.0;
      	if (((cosh(abs(x)) * t_0) / abs(z)) <= 4e+173)
      		tmp = t_0 / abs(z);
      	else
      		tmp = (abs(y) / abs(z)) / abs(x);
      	end
      	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp));
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 4e+173], N[(t$95$0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      t_0 := \frac{\left|y\right|}{\left|x\right|}\\
      \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
      \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 4 \cdot 10^{+173}:\\
      \;\;\;\;\frac{t\_0}{\left|z\right|}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\
      
      
      \end{array}\right)\right)
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 4.0000000000000001e173

        1. Initial program 85.1%

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

          \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

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

            \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
        4. Applied rewrites49.4%

          \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
        5. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
          2. lift-*.f64N/A

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

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

            \[\leadsto \frac{\frac{y}{x}}{\color{blue}{z}} \]
          5. lower-/.f6449.5%

            \[\leadsto \frac{\frac{y}{x}}{z} \]
        6. Applied rewrites49.5%

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

        if 4.0000000000000001e173 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

        1. Initial program 85.1%

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

            \[\leadsto \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
          2. mult-flipN/A

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

            \[\leadsto \color{blue}{\left(\cosh x \cdot \frac{y}{x}\right)} \cdot \frac{1}{z} \]
          4. lift-/.f64N/A

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

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

            \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
          7. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
          8. mult-flip-revN/A

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

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

            \[\leadsto \frac{\frac{\color{blue}{y \cdot \cosh x}}{z}}{x} \]
          11. lower-*.f6496.2%

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

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

          \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
        5. Step-by-step derivation
          1. Applied rewrites53.6%

            \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
        6. Recombined 2 regimes into one program.
        7. Add Preprocessing

        Alternative 7: 56.6% accurate, 0.3× speedup?

        \[\mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\ \;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|} \cdot \left|z\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\ \end{array}\right)\right) \]
        (FPCore (x y z)
          :precision binary64
          (*
         (copysign 1.0 x)
         (*
          (copysign 1.0 y)
          (*
           (copysign 1.0 z)
           (if (<=
                (/ (* (cosh (fabs x)) (/ (fabs y) (fabs x))) (fabs z))
                2e-102)
             (/ 1.0 (* (/ (fabs x) (fabs y)) (fabs z)))
             (/ (/ (fabs y) (fabs z)) (fabs x)))))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (((cosh(fabs(x)) * (fabs(y) / fabs(x))) / fabs(z)) <= 2e-102) {
        		tmp = 1.0 / ((fabs(x) / fabs(y)) * fabs(z));
        	} else {
        		tmp = (fabs(y) / fabs(z)) / fabs(x);
        	}
        	return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
        }
        
        public static double code(double x, double y, double z) {
        	double tmp;
        	if (((Math.cosh(Math.abs(x)) * (Math.abs(y) / Math.abs(x))) / Math.abs(z)) <= 2e-102) {
        		tmp = 1.0 / ((Math.abs(x) / Math.abs(y)) * Math.abs(z));
        	} else {
        		tmp = (Math.abs(y) / Math.abs(z)) / Math.abs(x);
        	}
        	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
        }
        
        def code(x, y, z):
        	tmp = 0
        	if ((math.cosh(math.fabs(x)) * (math.fabs(y) / math.fabs(x))) / math.fabs(z)) <= 2e-102:
        		tmp = 1.0 / ((math.fabs(x) / math.fabs(y)) * math.fabs(z))
        	else:
        		tmp = (math.fabs(y) / math.fabs(z)) / math.fabs(x)
        	return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
        
        function code(x, y, z)
        	tmp = 0.0
        	if (Float64(Float64(cosh(abs(x)) * Float64(abs(y) / abs(x))) / abs(z)) <= 2e-102)
        		tmp = Float64(1.0 / Float64(Float64(abs(x) / abs(y)) * abs(z)));
        	else
        		tmp = Float64(Float64(abs(y) / abs(z)) / abs(x));
        	end
        	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp)))
        end
        
        function tmp_2 = code(x, y, z)
        	tmp = 0.0;
        	if (((cosh(abs(x)) * (abs(y) / abs(x))) / abs(z)) <= 2e-102)
        		tmp = 1.0 / ((abs(x) / abs(y)) * abs(z));
        	else
        		tmp = (abs(y) / abs(z)) / abs(x);
        	end
        	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp));
        end
        
        code[x_, y_, z_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 2e-102], N[(1.0 / N[(N[(N[Abs[x], $MachinePrecision] / N[Abs[y], $MachinePrecision]), $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[y], $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
        \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot \frac{\left|y\right|}{\left|x\right|}}{\left|z\right|} \leq 2 \cdot 10^{-102}:\\
        \;\;\;\;\frac{1}{\frac{\left|x\right|}{\left|y\right|} \cdot \left|z\right|}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{\left|y\right|}{\left|z\right|}}{\left|x\right|}\\
        
        
        \end{array}\right)\right)
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 1.9999999999999999e-102

          1. Initial program 85.1%

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

              \[\leadsto \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
            2. mult-flipN/A

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

              \[\leadsto \color{blue}{\left(\cosh x \cdot \frac{y}{x}\right)} \cdot \frac{1}{z} \]
            4. lift-/.f64N/A

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

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

              \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
            7. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
            8. mult-flip-revN/A

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

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

              \[\leadsto \frac{\frac{\color{blue}{y \cdot \cosh x}}{z}}{x} \]
            11. lower-*.f6496.2%

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

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

            \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
          5. Step-by-step derivation
            1. Applied rewrites53.6%

              \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
            2. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{y}{z}}{x}} \]
              2. lift-/.f64N/A

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

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

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

                \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
              6. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
              7. lower-/.f6449.5%

                \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{z} \]
            3. Applied rewrites49.5%

              \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
            4. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{y}{x}}{z}} \]
              2. mult-flipN/A

                \[\leadsto \color{blue}{\frac{y}{x} \cdot \frac{1}{z}} \]
              3. lift-/.f64N/A

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

                \[\leadsto \color{blue}{\frac{y \cdot \frac{1}{z}}{x}} \]
              5. mult-flipN/A

                \[\leadsto \frac{\color{blue}{\frac{y}{z}}}{x} \]
              6. lift-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{y}{z}}}{x} \]
              7. div-flip-revN/A

                \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{y}{z}}}} \]
              8. lift-/.f64N/A

                \[\leadsto \frac{1}{\color{blue}{\frac{x}{\frac{y}{z}}}} \]
              9. lift-/.f6453.5%

                \[\leadsto \color{blue}{\frac{1}{\frac{x}{\frac{y}{z}}}} \]
              10. lift-/.f64N/A

                \[\leadsto \frac{1}{\color{blue}{\frac{x}{\frac{y}{z}}}} \]
              11. lift-/.f64N/A

                \[\leadsto \frac{1}{\frac{x}{\color{blue}{\frac{y}{z}}}} \]
              12. associate-/r/N/A

                \[\leadsto \frac{1}{\color{blue}{\frac{x}{y} \cdot z}} \]
              13. lower-*.f64N/A

                \[\leadsto \frac{1}{\color{blue}{\frac{x}{y} \cdot z}} \]
              14. lower-/.f6449.7%

                \[\leadsto \frac{1}{\color{blue}{\frac{x}{y}} \cdot z} \]
            5. Applied rewrites49.7%

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

            if 1.9999999999999999e-102 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

            1. Initial program 85.1%

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

                \[\leadsto \color{blue}{\frac{\cosh x \cdot \frac{y}{x}}{z}} \]
              2. mult-flipN/A

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

                \[\leadsto \color{blue}{\left(\cosh x \cdot \frac{y}{x}\right)} \cdot \frac{1}{z} \]
              4. lift-/.f64N/A

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

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

                \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\left(\cosh x \cdot y\right) \cdot \frac{1}{z}}{x}} \]
              8. mult-flip-revN/A

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

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

                \[\leadsto \frac{\frac{\color{blue}{y \cdot \cosh x}}{z}}{x} \]
              11. lower-*.f6496.2%

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

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

              \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
            5. Step-by-step derivation
              1. Applied rewrites53.6%

                \[\leadsto \frac{\frac{\color{blue}{y}}{z}}{x} \]
            6. Recombined 2 regimes into one program.
            7. Add Preprocessing

            Alternative 8: 52.9% accurate, 0.3× speedup?

            \[\begin{array}{l} t_0 := \frac{\left|y\right|}{\left|x\right|}\\ \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 10^{+296}:\\ \;\;\;\;\frac{t\_0}{\left|z\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|y\right|}{\left|x\right| \cdot \left|z\right|}\\ \end{array}\right)\right) \end{array} \]
            (FPCore (x y z)
              :precision binary64
              (let* ((t_0 (/ (fabs y) (fabs x))))
              (*
               (copysign 1.0 x)
               (*
                (copysign 1.0 y)
                (*
                 (copysign 1.0 z)
                 (if (<= (/ (* (cosh (fabs x)) t_0) (fabs z)) 1e+296)
                   (/ t_0 (fabs z))
                   (/ (fabs y) (* (fabs x) (fabs z)))))))))
            double code(double x, double y, double z) {
            	double t_0 = fabs(y) / fabs(x);
            	double tmp;
            	if (((cosh(fabs(x)) * t_0) / fabs(z)) <= 1e+296) {
            		tmp = t_0 / fabs(z);
            	} else {
            		tmp = fabs(y) / (fabs(x) * fabs(z));
            	}
            	return copysign(1.0, x) * (copysign(1.0, y) * (copysign(1.0, z) * tmp));
            }
            
            public static double code(double x, double y, double z) {
            	double t_0 = Math.abs(y) / Math.abs(x);
            	double tmp;
            	if (((Math.cosh(Math.abs(x)) * t_0) / Math.abs(z)) <= 1e+296) {
            		tmp = t_0 / Math.abs(z);
            	} else {
            		tmp = Math.abs(y) / (Math.abs(x) * Math.abs(z));
            	}
            	return Math.copySign(1.0, x) * (Math.copySign(1.0, y) * (Math.copySign(1.0, z) * tmp));
            }
            
            def code(x, y, z):
            	t_0 = math.fabs(y) / math.fabs(x)
            	tmp = 0
            	if ((math.cosh(math.fabs(x)) * t_0) / math.fabs(z)) <= 1e+296:
            		tmp = t_0 / math.fabs(z)
            	else:
            		tmp = math.fabs(y) / (math.fabs(x) * math.fabs(z))
            	return math.copysign(1.0, x) * (math.copysign(1.0, y) * (math.copysign(1.0, z) * tmp))
            
            function code(x, y, z)
            	t_0 = Float64(abs(y) / abs(x))
            	tmp = 0.0
            	if (Float64(Float64(cosh(abs(x)) * t_0) / abs(z)) <= 1e+296)
            		tmp = Float64(t_0 / abs(z));
            	else
            		tmp = Float64(abs(y) / Float64(abs(x) * abs(z)));
            	end
            	return Float64(copysign(1.0, x) * Float64(copysign(1.0, y) * Float64(copysign(1.0, z) * tmp)))
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = abs(y) / abs(x);
            	tmp = 0.0;
            	if (((cosh(abs(x)) * t_0) / abs(z)) <= 1e+296)
            		tmp = t_0 / abs(z);
            	else
            		tmp = abs(y) / (abs(x) * abs(z));
            	end
            	tmp_2 = (sign(x) * abs(1.0)) * ((sign(y) * abs(1.0)) * ((sign(z) * abs(1.0)) * tmp));
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[y], $MachinePrecision] / N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[(N[Cosh[N[Abs[x], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Abs[z], $MachinePrecision]), $MachinePrecision], 1e+296], N[(t$95$0 / N[Abs[z], $MachinePrecision]), $MachinePrecision], N[(N[Abs[y], $MachinePrecision] / N[(N[Abs[x], $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            t_0 := \frac{\left|y\right|}{\left|x\right|}\\
            \mathsf{copysign}\left(1, x\right) \cdot \left(\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, z\right) \cdot \begin{array}{l}
            \mathbf{if}\;\frac{\cosh \left(\left|x\right|\right) \cdot t\_0}{\left|z\right|} \leq 10^{+296}:\\
            \;\;\;\;\frac{t\_0}{\left|z\right|}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\left|y\right|}{\left|x\right| \cdot \left|z\right|}\\
            
            
            \end{array}\right)\right)
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.9999999999999998e295

              1. Initial program 85.1%

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

                \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

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

                  \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
              4. Applied rewrites49.4%

                \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
              5. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto \frac{y}{\color{blue}{x \cdot z}} \]
                2. lift-*.f64N/A

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

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

                  \[\leadsto \frac{\frac{y}{x}}{\color{blue}{z}} \]
                5. lower-/.f6449.5%

                  \[\leadsto \frac{\frac{y}{x}}{z} \]
              6. Applied rewrites49.5%

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

              if 9.9999999999999998e295 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

              1. Initial program 85.1%

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

                \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

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

                  \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
              4. Applied rewrites49.4%

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

            Alternative 9: 49.4% accurate, 7.5× speedup?

            \[\frac{y}{x \cdot z} \]
            (FPCore (x y z)
              :precision binary64
              (/ y (* x z)))
            double code(double x, double y, double z) {
            	return y / (x * z);
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, y, z)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                code = y / (x * z)
            end function
            
            public static double code(double x, double y, double z) {
            	return y / (x * z);
            }
            
            def code(x, y, z):
            	return y / (x * z)
            
            function code(x, y, z)
            	return Float64(y / Float64(x * z))
            end
            
            function tmp = code(x, y, z)
            	tmp = y / (x * z);
            end
            
            code[x_, y_, z_] := N[(y / N[(x * z), $MachinePrecision]), $MachinePrecision]
            
            \frac{y}{x \cdot z}
            
            Derivation
            1. Initial program 85.1%

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

              \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

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

                \[\leadsto \frac{y}{x \cdot \color{blue}{z}} \]
            4. Applied rewrites49.4%

              \[\leadsto \color{blue}{\frac{y}{x \cdot z}} \]
            5. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025258 
            (FPCore (x y z)
              :name "Linear.Quaternion:$ctan from linear-1.19.1.3"
              :precision binary64
              (/ (* (cosh x) (/ y x)) z))