Linear.Quaternion:$ctan from linear-1.19.1.3

Percentage Accurate: 84.9% → 97.3%
Time: 3.9s
Alternatives: 16
Speedup: 0.9×

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;
}
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]
\begin{array}{l}

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

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 16 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;
}
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]
\begin{array}{l}

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

Alternative 1: 97.3% accurate, 0.8× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;y\_m \leq 4.9 \cdot 10^{+70}:\\ \;\;\;\;\frac{\frac{\cosh x \cdot y\_m}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y\_m, 0.5, y\_m\right)}{z}}{x}\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= y_m 4.9e+70)
    (/ (/ (* (cosh x) y_m) x) z)
    (/ (/ (fma (* (* x x) y_m) 0.5 y_m) z) x))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (y_m <= 4.9e+70) {
		tmp = ((cosh(x) * y_m) / x) / z;
	} else {
		tmp = (fma(((x * x) * y_m), 0.5, y_m) / z) / x;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (y_m <= 4.9e+70)
		tmp = Float64(Float64(Float64(cosh(x) * y_m) / x) / z);
	else
		tmp = Float64(Float64(fma(Float64(Float64(x * x) * y_m), 0.5, y_m) / z) / x);
	end
	return Float64(y_s * tmp)
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[y$95$m, 4.9e+70], N[(N[(N[(N[Cosh[x], $MachinePrecision] * y$95$m), $MachinePrecision] / x), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5 + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;y\_m \leq 4.9 \cdot 10^{+70}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y\_m}{x}}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.90000000000000028e70

    1. Initial program 81.2%

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

        \[\leadsto \frac{\color{blue}{\cosh x \cdot \frac{y}{x}}}{z} \]
      2. lift-cosh.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. lower-/.f64N/A

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

        \[\leadsto \frac{\frac{\color{blue}{\cosh x \cdot y}}{x}}{z} \]
      7. lift-cosh.f6499.4

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

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

    if 4.90000000000000028e70 < y

    1. Initial program 90.9%

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
      3. div-add-revN/A

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

        \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      5. lower-/.f64N/A

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

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

        \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      8. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      11. lower-*.f6494.1

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
    4. Applied rewrites94.1%

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

Alternative 2: 88.8% accurate, 0.7× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 20:\\ \;\;\;\;\frac{\cosh x \cdot y\_m}{z \cdot x}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{+154}:\\ \;\;\;\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\frac{x \cdot x}{z}}{x} \cdot y\_m\right) \cdot 0.5\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= x 20.0)
    (/ (* (cosh x) y_m) (* z x))
    (if (<= x 1.5e+154)
      (/ (* (cosh x) (/ y_m x)) z)
      (* (* (/ (/ (* x x) z) x) y_m) 0.5)))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (x <= 20.0) {
		tmp = (cosh(x) * y_m) / (z * x);
	} else if (x <= 1.5e+154) {
		tmp = (cosh(x) * (y_m / x)) / z;
	} else {
		tmp = ((((x * x) / z) / x) * y_m) * 0.5;
	}
	return y_s * tmp;
}
y\_m =     private
y\_s =     private
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(y_s, x, y_m, z)
use fmin_fmax_functions
    real(8), intent (in) :: y_s
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 20.0d0) then
        tmp = (cosh(x) * y_m) / (z * x)
    else if (x <= 1.5d+154) then
        tmp = (cosh(x) * (y_m / x)) / z
    else
        tmp = ((((x * x) / z) / x) * y_m) * 0.5d0
    end if
    code = y_s * tmp
end function
y\_m = Math.abs(y);
y\_s = Math.copySign(1.0, y);
public static double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (x <= 20.0) {
		tmp = (Math.cosh(x) * y_m) / (z * x);
	} else if (x <= 1.5e+154) {
		tmp = (Math.cosh(x) * (y_m / x)) / z;
	} else {
		tmp = ((((x * x) / z) / x) * y_m) * 0.5;
	}
	return y_s * tmp;
}
y\_m = math.fabs(y)
y\_s = math.copysign(1.0, y)
def code(y_s, x, y_m, z):
	tmp = 0
	if x <= 20.0:
		tmp = (math.cosh(x) * y_m) / (z * x)
	elif x <= 1.5e+154:
		tmp = (math.cosh(x) * (y_m / x)) / z
	else:
		tmp = ((((x * x) / z) / x) * y_m) * 0.5
	return y_s * tmp
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (x <= 20.0)
		tmp = Float64(Float64(cosh(x) * y_m) / Float64(z * x));
	elseif (x <= 1.5e+154)
		tmp = Float64(Float64(cosh(x) * Float64(y_m / x)) / z);
	else
		tmp = Float64(Float64(Float64(Float64(Float64(x * x) / z) / x) * y_m) * 0.5);
	end
	return Float64(y_s * tmp)
end
y\_m = abs(y);
y\_s = sign(y) * abs(1.0);
function tmp_2 = code(y_s, x, y_m, z)
	tmp = 0.0;
	if (x <= 20.0)
		tmp = (cosh(x) * y_m) / (z * x);
	elseif (x <= 1.5e+154)
		tmp = (cosh(x) * (y_m / x)) / z;
	else
		tmp = ((((x * x) / z) / x) * y_m) * 0.5;
	end
	tmp_2 = y_s * tmp;
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 20.0], N[(N[(N[Cosh[x], $MachinePrecision] * y$95$m), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e+154], N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 20:\\
\;\;\;\;\frac{\cosh x \cdot y\_m}{z \cdot x}\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z}\\

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


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

    1. Initial program 87.4%

      \[\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-cosh.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\cosh x \cdot y}{\color{blue}{z \cdot x}} \]
      11. lower-*.f6486.7

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

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

    if 20 < x < 1.50000000000000013e154

    1. Initial program 89.9%

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

    if 1.50000000000000013e154 < x

    1. Initial program 64.8%

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

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

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

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

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

        \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
      6. lower-/.f64N/A

        \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
      7. rec-expN/A

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

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

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

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

        \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
      12. lower-*.f6462.8

        \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot 0.5 \]
    4. Applied rewrites62.8%

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

      \[\leadsto \left(\frac{2 \cdot \frac{1}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \left(\frac{\frac{2 \cdot 1}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      3. metadata-evalN/A

        \[\leadsto \left(\frac{\frac{2}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      4. div-add-revN/A

        \[\leadsto \left(\frac{\frac{2 + {x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      5. lower-/.f64N/A

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

        \[\leadsto \left(\frac{\frac{{x}^{2} + 2}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      7. pow2N/A

        \[\leadsto \left(\frac{\frac{x \cdot x + 2}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      8. lower-fma.f64100.0

        \[\leadsto \left(\frac{\frac{\mathsf{fma}\left(x, x, 2\right)}{z}}{x} \cdot y\right) \cdot 0.5 \]
    7. Applied rewrites100.0%

      \[\leadsto \left(\frac{\frac{\mathsf{fma}\left(x, x, 2\right)}{z}}{x} \cdot y\right) \cdot 0.5 \]
    8. Taylor expanded in x around inf

      \[\leadsto \left(\frac{\frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
    9. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \left(\frac{\frac{x \cdot x}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      2. lift-*.f64100.0

        \[\leadsto \left(\frac{\frac{x \cdot x}{z}}{x} \cdot y\right) \cdot 0.5 \]
    10. Applied rewrites100.0%

      \[\leadsto \left(\frac{\frac{x \cdot x}{z}}{x} \cdot y\right) \cdot 0.5 \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 88.2% accurate, 0.9× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 2.65 \cdot 10^{+140}:\\ \;\;\;\;\frac{\cosh x \cdot y\_m}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y\_m, 0.5, y\_m\right)}{z}}{x}\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= x 2.65e+140)
    (/ (* (cosh x) y_m) (* z x))
    (/ (/ (fma (* (* x x) y_m) 0.5 y_m) z) x))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (x <= 2.65e+140) {
		tmp = (cosh(x) * y_m) / (z * x);
	} else {
		tmp = (fma(((x * x) * y_m), 0.5, y_m) / z) / x;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (x <= 2.65e+140)
		tmp = Float64(Float64(cosh(x) * y_m) / Float64(z * x));
	else
		tmp = Float64(Float64(fma(Float64(Float64(x * x) * y_m), 0.5, y_m) / z) / x);
	end
	return Float64(y_s * tmp)
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 2.65e+140], N[(N[(N[Cosh[x], $MachinePrecision] * y$95$m), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5 + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq 2.65 \cdot 10^{+140}:\\
\;\;\;\;\frac{\cosh x \cdot y\_m}{z \cdot x}\\

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


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

    1. Initial program 87.9%

      \[\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-cosh.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\cosh x \cdot y}{\color{blue}{z \cdot x}} \]
      11. lower-*.f6486.9

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

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

    if 2.64999999999999993e140 < x

    1. Initial program 65.9%

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
      3. div-add-revN/A

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

        \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      5. lower-/.f64N/A

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

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

        \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      8. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      11. lower-*.f6496.2

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
    4. Applied rewrites96.2%

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

Alternative 4: 77.8% accurate, 0.5× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+214}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y\_m, y\_m\right)}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y\_m, 0.5, y\_m\right)}{z}}{x}\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= (/ (* (cosh x) (/ y_m x)) z) 1e+214)
    (/ (fma (* (* x x) 0.5) y_m y_m) (* z x))
    (/ (/ (fma (* (* x x) y_m) 0.5 y_m) z) x))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (((cosh(x) * (y_m / x)) / z) <= 1e+214) {
		tmp = fma(((x * x) * 0.5), y_m, y_m) / (z * x);
	} else {
		tmp = (fma(((x * x) * y_m), 0.5, y_m) / z) / x;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 1e+214)
		tmp = Float64(fma(Float64(Float64(x * x) * 0.5), y_m, y_m) / Float64(z * x));
	else
		tmp = Float64(Float64(fma(Float64(Float64(x * x) * y_m), 0.5, y_m) / z) / x);
	end
	return Float64(y_s * tmp)
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 1e+214], N[(N[(N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision] * y$95$m + y$95$m), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5 + y$95$m), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+214}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y\_m, y\_m\right)}{z \cdot x}\\

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


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

    1. Initial program 96.4%

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
      3. div-add-revN/A

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

        \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      5. lower-/.f64N/A

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

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

        \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      8. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      11. lower-*.f6482.1

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
    4. Applied rewrites82.1%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      3. lift-fma.f64N/A

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

        \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      5. lift-*.f64N/A

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

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

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

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

        \[\leadsto \frac{\frac{1}{2} \cdot \left(\left(x \cdot x\right) \cdot y\right) + y}{x \cdot z} \]
      10. pow2N/A

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

        \[\leadsto \frac{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y + y}{x \cdot z} \]
      12. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left({x}^{2} \cdot \frac{1}{2}, y, y\right)}{x \cdot z} \]
      15. pow2N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{1}{2}, y, y\right)}{z \cdot \color{blue}{x}} \]
      18. lift-*.f6476.4

        \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y, y\right)}{z \cdot \color{blue}{x}} \]
    6. Applied rewrites76.4%

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

    if 9.9999999999999995e213 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 68.5%

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
      3. div-add-revN/A

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

        \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      5. lower-/.f64N/A

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

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

        \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      8. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      11. lower-*.f6478.6

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
    4. Applied rewrites78.6%

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

Alternative 5: 77.3% accurate, 0.5× speedup?

\[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+214}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y\_m, y\_m\right)}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, 0.5, 1\right)}{z}}{x}\\ \end{array} \end{array} \]
y\_m = (fabs.f64 y)
y\_s = (copysign.f64 #s(literal 1 binary64) y)
(FPCore (y_s x y_m z)
 :precision binary64
 (*
  y_s
  (if (<= (/ (* (cosh x) (/ y_m x)) z) 1e+214)
    (/ (fma (* (* x x) 0.5) y_m y_m) (* z x))
    (/ (* y_m (/ (fma (* x x) 0.5 1.0) z)) x))))
y\_m = fabs(y);
y\_s = copysign(1.0, y);
double code(double y_s, double x, double y_m, double z) {
	double tmp;
	if (((cosh(x) * (y_m / x)) / z) <= 1e+214) {
		tmp = fma(((x * x) * 0.5), y_m, y_m) / (z * x);
	} else {
		tmp = (y_m * (fma((x * x), 0.5, 1.0) / z)) / x;
	}
	return y_s * tmp;
}
y\_m = abs(y)
y\_s = copysign(1.0, y)
function code(y_s, x, y_m, z)
	tmp = 0.0
	if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 1e+214)
		tmp = Float64(fma(Float64(Float64(x * x) * 0.5), y_m, y_m) / Float64(z * x));
	else
		tmp = Float64(Float64(y_m * Float64(fma(Float64(x * x), 0.5, 1.0) / z)) / x);
	end
	return Float64(y_s * tmp)
end
y\_m = N[Abs[y], $MachinePrecision]
y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 1e+214], N[(N[(N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision] * y$95$m + y$95$m), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m * N[(N[(N[(x * x), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
y\_m = \left|y\right|
\\
y\_s = \mathsf{copysign}\left(1, y\right)

\\
y\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+214}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y\_m, y\_m\right)}{z \cdot x}\\

\mathbf{else}:\\
\;\;\;\;\frac{y\_m \cdot \frac{\mathsf{fma}\left(x \cdot x, 0.5, 1\right)}{z}}{x}\\


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

    1. Initial program 96.4%

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
      3. div-add-revN/A

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

        \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      5. lower-/.f64N/A

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

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

        \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      8. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      11. lower-*.f6482.1

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
    4. Applied rewrites82.1%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
    5. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      3. lift-fma.f64N/A

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

        \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      5. lift-*.f64N/A

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

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

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

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

        \[\leadsto \frac{\frac{1}{2} \cdot \left(\left(x \cdot x\right) \cdot y\right) + y}{x \cdot z} \]
      10. pow2N/A

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

        \[\leadsto \frac{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y + y}{x \cdot z} \]
      12. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left({x}^{2} \cdot \frac{1}{2}, y, y\right)}{x \cdot z} \]
      15. pow2N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{1}{2}, y, y\right)}{z \cdot \color{blue}{x}} \]
      18. lift-*.f6476.4

        \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y, y\right)}{z \cdot \color{blue}{x}} \]
    6. Applied rewrites76.4%

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

    if 9.9999999999999995e213 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

    1. Initial program 68.5%

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

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

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

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
      3. div-add-revN/A

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

        \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      5. lower-/.f64N/A

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

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

        \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
      8. lower-fma.f64N/A

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

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
      11. lower-*.f6478.6

        \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
    4. Applied rewrites78.6%

      \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
    5. Taylor expanded in x around 0

      \[\leadsto \frac{\frac{y}{z}}{x} \]
    6. Step-by-step derivation
      1. Applied rewrites35.4%

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

        \[\leadsto \frac{\frac{1}{2} \cdot \frac{{x}^{2} \cdot y}{z} + \frac{y}{z}}{x} \]
      3. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \frac{\frac{y}{z} + \frac{1}{2} \cdot \frac{{x}^{2} \cdot y}{z}}{x} \]
        2. associate-*r/N/A

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

          \[\leadsto \frac{\frac{1 \cdot y}{z} + \frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        4. div-addN/A

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

          \[\leadsto \frac{\frac{1 \cdot y + \left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y}{z}}{x} \]
        6. distribute-rgt-inN/A

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

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

          \[\leadsto \frac{y \cdot \frac{1 + \frac{1}{2} \cdot {x}^{2}}{z}}{x} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{y \cdot \frac{1 + \frac{1}{2} \cdot {x}^{2}}{z}}{x} \]
        10. +-commutativeN/A

          \[\leadsto \frac{y \cdot \frac{\frac{1}{2} \cdot {x}^{2} + 1}{z}}{x} \]
        11. *-commutativeN/A

          \[\leadsto \frac{y \cdot \frac{{x}^{2} \cdot \frac{1}{2} + 1}{z}}{x} \]
        12. lower-fma.f64N/A

          \[\leadsto \frac{y \cdot \frac{\mathsf{fma}\left({x}^{2}, \frac{1}{2}, 1\right)}{z}}{x} \]
        13. pow2N/A

          \[\leadsto \frac{y \cdot \frac{\mathsf{fma}\left(x \cdot x, \frac{1}{2}, 1\right)}{z}}{x} \]
        14. lift-*.f6479.8

          \[\leadsto \frac{y \cdot \frac{\mathsf{fma}\left(x \cdot x, 0.5, 1\right)}{z}}{x} \]
      4. Applied rewrites79.8%

        \[\leadsto \frac{y \cdot \frac{\mathsf{fma}\left(x \cdot x, 0.5, 1\right)}{z}}{x} \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 6: 74.5% accurate, 1.0× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 10^{+75}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y\_m, y\_m\right)}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (*
      y_s
      (if (<= x 1e+75)
        (/ (fma (* (* x x) 0.5) y_m y_m) (* z x))
        (/ (/ (* (* (* x x) y_m) 0.5) z) x))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1e+75) {
    		tmp = fma(((x * x) * 0.5), y_m, y_m) / (z * x);
    	} else {
    		tmp = ((((x * x) * y_m) * 0.5) / z) / x;
    	}
    	return y_s * tmp;
    }
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1e+75)
    		tmp = Float64(fma(Float64(Float64(x * x) * 0.5), y_m, y_m) / Float64(z * x));
    	else
    		tmp = Float64(Float64(Float64(Float64(Float64(x * x) * y_m) * 0.5) / z) / x);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1e+75], N[(N[(N[(N[(x * x), $MachinePrecision] * 0.5), $MachinePrecision] * y$95$m + y$95$m), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 10^{+75}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y\_m, y\_m\right)}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 9.99999999999999927e74

      1. Initial program 88.1%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6480.4

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites80.4%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        3. lift-fma.f64N/A

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

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        5. lift-*.f64N/A

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

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

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

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

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\left(x \cdot x\right) \cdot y\right) + y}{x \cdot z} \]
        10. pow2N/A

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

          \[\leadsto \frac{\left(\frac{1}{2} \cdot {x}^{2}\right) \cdot y + y}{x \cdot z} \]
        12. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\mathsf{fma}\left({x}^{2} \cdot \frac{1}{2}, y, y\right)}{x \cdot z} \]
        15. pow2N/A

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{1}{2}, y, y\right)}{z \cdot \color{blue}{x}} \]
        18. lift-*.f6472.9

          \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot 0.5, y, y\right)}{z \cdot \color{blue}{x}} \]
      6. Applied rewrites72.9%

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

      if 9.99999999999999927e74 < x

      1. Initial program 71.4%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6481.6

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites81.6%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        3. pow2N/A

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

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        5. lift-*.f6481.6

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot 0.5}{z}}{x} \]
      7. Applied rewrites81.6%

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

    Alternative 7: 74.5% accurate, 1.0× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 10^{+75}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x, x, 2\right) \cdot y\_m}{z \cdot x} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (*
      y_s
      (if (<= x 1e+75)
        (* (/ (* (fma x x 2.0) y_m) (* z x)) 0.5)
        (/ (/ (* (* (* x x) y_m) 0.5) z) x))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1e+75) {
    		tmp = ((fma(x, x, 2.0) * y_m) / (z * x)) * 0.5;
    	} else {
    		tmp = ((((x * x) * y_m) * 0.5) / z) / x;
    	}
    	return y_s * tmp;
    }
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1e+75)
    		tmp = Float64(Float64(Float64(fma(x, x, 2.0) * y_m) / Float64(z * x)) * 0.5);
    	else
    		tmp = Float64(Float64(Float64(Float64(Float64(x * x) * y_m) * 0.5) / z) / x);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1e+75], N[(N[(N[(N[(x * x + 2.0), $MachinePrecision] * y$95$m), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 10^{+75}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(x, x, 2\right) \cdot y\_m}{z \cdot x} \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 9.99999999999999927e74

      1. Initial program 88.1%

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

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

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

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

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

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        6. lower-/.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        7. rec-expN/A

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

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

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

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

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        12. lower-*.f6486.9

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot 0.5 \]
      4. Applied rewrites86.9%

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

        \[\leadsto \left(\frac{2 + {x}^{2}}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(\frac{{x}^{2} + 2}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        2. pow2N/A

          \[\leadsto \left(\frac{x \cdot x + 2}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        3. lower-fma.f6471.6

          \[\leadsto \left(\frac{\mathsf{fma}\left(x, x, 2\right)}{z \cdot x} \cdot y\right) \cdot 0.5 \]
      7. Applied rewrites71.6%

        \[\leadsto \left(\frac{\mathsf{fma}\left(x, x, 2\right)}{z \cdot x} \cdot y\right) \cdot 0.5 \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

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

          \[\leadsto \left(\frac{\mathsf{fma}\left(x, x, 2\right)}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        3. lift-/.f64N/A

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

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

          \[\leadsto \frac{\mathsf{fma}\left(x, x, 2\right) \cdot y}{x \cdot z} \cdot \frac{1}{2} \]
        6. lower-/.f64N/A

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

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

          \[\leadsto \frac{\mathsf{fma}\left(x, x, 2\right) \cdot y}{z \cdot x} \cdot \frac{1}{2} \]
        9. lift-*.f6472.9

          \[\leadsto \frac{\mathsf{fma}\left(x, x, 2\right) \cdot y}{z \cdot x} \cdot 0.5 \]
      9. Applied rewrites72.9%

        \[\leadsto \frac{\mathsf{fma}\left(x, x, 2\right) \cdot y}{z \cdot x} \cdot 0.5 \]

      if 9.99999999999999927e74 < x

      1. Initial program 71.4%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6481.6

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites81.6%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        3. pow2N/A

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

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        5. lift-*.f6481.6

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot 0.5}{z}}{x} \]
      7. Applied rewrites81.6%

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

    Alternative 8: 74.0% accurate, 1.0× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 10^{+15}:\\ \;\;\;\;\left(\frac{\mathsf{fma}\left(x, x, 2\right)}{z \cdot x} \cdot y\_m\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (*
      y_s
      (if (<= x 1e+15)
        (* (* (/ (fma x x 2.0) (* z x)) y_m) 0.5)
        (/ (/ (* (* (* x x) y_m) 0.5) z) x))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1e+15) {
    		tmp = ((fma(x, x, 2.0) / (z * x)) * y_m) * 0.5;
    	} else {
    		tmp = ((((x * x) * y_m) * 0.5) / z) / x;
    	}
    	return y_s * tmp;
    }
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1e+15)
    		tmp = Float64(Float64(Float64(fma(x, x, 2.0) / Float64(z * x)) * y_m) * 0.5);
    	else
    		tmp = Float64(Float64(Float64(Float64(Float64(x * x) * y_m) * 0.5) / z) / x);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1e+15], N[(N[(N[(N[(x * x + 2.0), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 10^{+15}:\\
    \;\;\;\;\left(\frac{\mathsf{fma}\left(x, x, 2\right)}{z \cdot x} \cdot y\_m\right) \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1e15

      1. Initial program 87.6%

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

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

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

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

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

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        6. lower-/.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        7. rec-expN/A

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

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

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

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

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        12. lower-*.f6486.5

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot 0.5 \]
      4. Applied rewrites86.5%

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

        \[\leadsto \left(\frac{2 + {x}^{2}}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(\frac{{x}^{2} + 2}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        2. pow2N/A

          \[\leadsto \left(\frac{x \cdot x + 2}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        3. lower-fma.f6474.9

          \[\leadsto \left(\frac{\mathsf{fma}\left(x, x, 2\right)}{z \cdot x} \cdot y\right) \cdot 0.5 \]
      7. Applied rewrites74.9%

        \[\leadsto \left(\frac{\mathsf{fma}\left(x, x, 2\right)}{z \cdot x} \cdot y\right) \cdot 0.5 \]

      if 1e15 < x

      1. Initial program 76.5%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6471.2

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites71.2%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        3. pow2N/A

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

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        5. lift-*.f6471.2

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot 0.5}{z}}{x} \]
      7. Applied rewrites71.2%

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

    Alternative 9: 64.9% accurate, 1.0× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 1.45:\\ \;\;\;\;\frac{y\_m}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (* y_s (if (<= x 1.45) (/ y_m (* z x)) (/ (/ (* (* (* x x) y_m) 0.5) z) x))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = ((((x * x) * y_m) * 0.5) / z) / x;
    	}
    	return y_s * tmp;
    }
    
    y\_m =     private
    y\_s =     private
    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(y_s, x, y_m, z)
    use fmin_fmax_functions
        real(8), intent (in) :: y_s
        real(8), intent (in) :: x
        real(8), intent (in) :: y_m
        real(8), intent (in) :: z
        real(8) :: tmp
        if (x <= 1.45d0) then
            tmp = y_m / (z * x)
        else
            tmp = ((((x * x) * y_m) * 0.5d0) / z) / x
        end if
        code = y_s * tmp
    end function
    
    y\_m = Math.abs(y);
    y\_s = Math.copySign(1.0, y);
    public static double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = ((((x * x) * y_m) * 0.5) / z) / x;
    	}
    	return y_s * tmp;
    }
    
    y\_m = math.fabs(y)
    y\_s = math.copysign(1.0, y)
    def code(y_s, x, y_m, z):
    	tmp = 0
    	if x <= 1.45:
    		tmp = y_m / (z * x)
    	else:
    		tmp = ((((x * x) * y_m) * 0.5) / z) / x
    	return y_s * tmp
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1.45)
    		tmp = Float64(y_m / Float64(z * x));
    	else
    		tmp = Float64(Float64(Float64(Float64(Float64(x * x) * y_m) * 0.5) / z) / x);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = abs(y);
    y\_s = sign(y) * abs(1.0);
    function tmp_2 = code(y_s, x, y_m, z)
    	tmp = 0.0;
    	if (x <= 1.45)
    		tmp = y_m / (z * x);
    	else
    		tmp = ((((x * x) * y_m) * 0.5) / z) / x;
    	end
    	tmp_2 = y_s * tmp;
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.45], N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 1.45:\\
    \;\;\;\;\frac{y\_m}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1.44999999999999996

      1. Initial program 87.4%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6463.8

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

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

      if 1.44999999999999996 < x

      1. Initial program 77.7%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6468.3

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites68.3%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        3. pow2N/A

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

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        5. lift-*.f6468.3

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot 0.5}{z}}{x} \]
      7. Applied rewrites68.3%

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

    Alternative 10: 64.5% accurate, 1.0× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 1.45:\\ \;\;\;\;\frac{y\_m}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\frac{x \cdot x}{z}}{x} \cdot y\_m\right) \cdot 0.5\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (* y_s (if (<= x 1.45) (/ y_m (* z x)) (* (* (/ (/ (* x x) z) x) y_m) 0.5))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = ((((x * x) / z) / x) * y_m) * 0.5;
    	}
    	return y_s * tmp;
    }
    
    y\_m =     private
    y\_s =     private
    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(y_s, x, y_m, z)
    use fmin_fmax_functions
        real(8), intent (in) :: y_s
        real(8), intent (in) :: x
        real(8), intent (in) :: y_m
        real(8), intent (in) :: z
        real(8) :: tmp
        if (x <= 1.45d0) then
            tmp = y_m / (z * x)
        else
            tmp = ((((x * x) / z) / x) * y_m) * 0.5d0
        end if
        code = y_s * tmp
    end function
    
    y\_m = Math.abs(y);
    y\_s = Math.copySign(1.0, y);
    public static double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = ((((x * x) / z) / x) * y_m) * 0.5;
    	}
    	return y_s * tmp;
    }
    
    y\_m = math.fabs(y)
    y\_s = math.copysign(1.0, y)
    def code(y_s, x, y_m, z):
    	tmp = 0
    	if x <= 1.45:
    		tmp = y_m / (z * x)
    	else:
    		tmp = ((((x * x) / z) / x) * y_m) * 0.5
    	return y_s * tmp
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1.45)
    		tmp = Float64(y_m / Float64(z * x));
    	else
    		tmp = Float64(Float64(Float64(Float64(Float64(x * x) / z) / x) * y_m) * 0.5);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = abs(y);
    y\_s = sign(y) * abs(1.0);
    function tmp_2 = code(y_s, x, y_m, z)
    	tmp = 0.0;
    	if (x <= 1.45)
    		tmp = y_m / (z * x);
    	else
    		tmp = ((((x * x) / z) / x) * y_m) * 0.5;
    	end
    	tmp_2 = y_s * tmp;
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.45], N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x * x), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 1.45:\\
    \;\;\;\;\frac{y\_m}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\frac{\frac{x \cdot x}{z}}{x} \cdot y\_m\right) \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1.44999999999999996

      1. Initial program 87.4%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6463.8

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

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

      if 1.44999999999999996 < x

      1. Initial program 77.7%

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

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

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

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

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

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        6. lower-/.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        7. rec-expN/A

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

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

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

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

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        12. lower-*.f6475.6

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot 0.5 \]
      4. Applied rewrites75.6%

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

        \[\leadsto \left(\frac{2 \cdot \frac{1}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \left(\frac{\frac{2 \cdot 1}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        3. metadata-evalN/A

          \[\leadsto \left(\frac{\frac{2}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        4. div-add-revN/A

          \[\leadsto \left(\frac{\frac{2 + {x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        5. lower-/.f64N/A

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

          \[\leadsto \left(\frac{\frac{{x}^{2} + 2}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        7. pow2N/A

          \[\leadsto \left(\frac{\frac{x \cdot x + 2}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        8. lower-fma.f6466.7

          \[\leadsto \left(\frac{\frac{\mathsf{fma}\left(x, x, 2\right)}{z}}{x} \cdot y\right) \cdot 0.5 \]
      7. Applied rewrites66.7%

        \[\leadsto \left(\frac{\frac{\mathsf{fma}\left(x, x, 2\right)}{z}}{x} \cdot y\right) \cdot 0.5 \]
      8. Taylor expanded in x around inf

        \[\leadsto \left(\frac{\frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      9. Step-by-step derivation
        1. pow2N/A

          \[\leadsto \left(\frac{\frac{x \cdot x}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        2. lift-*.f6466.7

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

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

    Alternative 11: 59.3% accurate, 0.9× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 1.45:\\ \;\;\;\;\frac{y\_m}{z \cdot x}\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+259}:\\ \;\;\;\;\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 \cdot \left(y\_m \cdot x\right)}{z}\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (*
      y_s
      (if (<= x 1.45)
        (/ y_m (* z x))
        (if (<= x 3.5e+259)
          (/ (* (* (* x x) y_m) 0.5) (* z x))
          (/ (* 0.5 (* y_m x)) z)))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else if (x <= 3.5e+259) {
    		tmp = (((x * x) * y_m) * 0.5) / (z * x);
    	} else {
    		tmp = (0.5 * (y_m * x)) / z;
    	}
    	return y_s * tmp;
    }
    
    y\_m =     private
    y\_s =     private
    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(y_s, x, y_m, z)
    use fmin_fmax_functions
        real(8), intent (in) :: y_s
        real(8), intent (in) :: x
        real(8), intent (in) :: y_m
        real(8), intent (in) :: z
        real(8) :: tmp
        if (x <= 1.45d0) then
            tmp = y_m / (z * x)
        else if (x <= 3.5d+259) then
            tmp = (((x * x) * y_m) * 0.5d0) / (z * x)
        else
            tmp = (0.5d0 * (y_m * x)) / z
        end if
        code = y_s * tmp
    end function
    
    y\_m = Math.abs(y);
    y\_s = Math.copySign(1.0, y);
    public static double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else if (x <= 3.5e+259) {
    		tmp = (((x * x) * y_m) * 0.5) / (z * x);
    	} else {
    		tmp = (0.5 * (y_m * x)) / z;
    	}
    	return y_s * tmp;
    }
    
    y\_m = math.fabs(y)
    y\_s = math.copysign(1.0, y)
    def code(y_s, x, y_m, z):
    	tmp = 0
    	if x <= 1.45:
    		tmp = y_m / (z * x)
    	elif x <= 3.5e+259:
    		tmp = (((x * x) * y_m) * 0.5) / (z * x)
    	else:
    		tmp = (0.5 * (y_m * x)) / z
    	return y_s * tmp
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1.45)
    		tmp = Float64(y_m / Float64(z * x));
    	elseif (x <= 3.5e+259)
    		tmp = Float64(Float64(Float64(Float64(x * x) * y_m) * 0.5) / Float64(z * x));
    	else
    		tmp = Float64(Float64(0.5 * Float64(y_m * x)) / z);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = abs(y);
    y\_s = sign(y) * abs(1.0);
    function tmp_2 = code(y_s, x, y_m, z)
    	tmp = 0.0;
    	if (x <= 1.45)
    		tmp = y_m / (z * x);
    	elseif (x <= 3.5e+259)
    		tmp = (((x * x) * y_m) * 0.5) / (z * x);
    	else
    		tmp = (0.5 * (y_m * x)) / z;
    	end
    	tmp_2 = y_s * tmp;
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.45], N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+259], N[(N[(N[(N[(x * x), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision] / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 1.45:\\
    \;\;\;\;\frac{y\_m}{z \cdot x}\\
    
    \mathbf{elif}\;x \leq 3.5 \cdot 10^{+259}:\\
    \;\;\;\;\frac{\left(\left(x \cdot x\right) \cdot y\_m\right) \cdot 0.5}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{0.5 \cdot \left(y\_m \cdot x\right)}{z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < 1.44999999999999996

      1. Initial program 87.4%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6463.8

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

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

      if 1.44999999999999996 < x < 3.4999999999999998e259

      1. Initial program 81.9%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6462.4

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites62.4%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

        \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        3. pow2N/A

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

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2}}{z}}{x} \]
        5. lift-*.f6462.4

          \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot 0.5}{z}}{x} \]
      7. Applied rewrites62.4%

        \[\leadsto \frac{\frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot 0.5}{z}}{x} \]
      8. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

          \[\leadsto \frac{\left(\left(x \cdot x\right) \cdot y\right) \cdot \frac{1}{2}}{z \cdot \color{blue}{x}} \]
        7. lift-*.f6444.3

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

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

      if 3.4999999999999998e259 < x

      1. Initial program 55.0%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f64100.0

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites100.0%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

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

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

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

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

          \[\leadsto \left(x \cdot \frac{y}{z}\right) \cdot \frac{1}{2} \]
        5. lower-/.f6447.5

          \[\leadsto \left(x \cdot \frac{y}{z}\right) \cdot 0.5 \]
      7. Applied rewrites47.5%

        \[\leadsto \left(x \cdot \frac{y}{z}\right) \cdot \color{blue}{0.5} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

          \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{z} \]
        6. associate-*r/N/A

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

          \[\leadsto \frac{\frac{1}{2} \cdot \left(x \cdot y\right)}{z} \]
        8. lower-*.f64N/A

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

          \[\leadsto \frac{\frac{1}{2} \cdot \left(y \cdot x\right)}{z} \]
        10. lower-*.f6457.9

          \[\leadsto \frac{0.5 \cdot \left(y \cdot x\right)}{z} \]
      9. Applied rewrites57.9%

        \[\leadsto \frac{0.5 \cdot \left(y \cdot x\right)}{z} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 12: 57.5% accurate, 1.5× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 1.45:\\ \;\;\;\;\frac{y\_m}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x}{z} \cdot y\_m\right) \cdot 0.5\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (* y_s (if (<= x 1.45) (/ y_m (* z x)) (* (* (/ x z) y_m) 0.5))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = ((x / z) * y_m) * 0.5;
    	}
    	return y_s * tmp;
    }
    
    y\_m =     private
    y\_s =     private
    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(y_s, x, y_m, z)
    use fmin_fmax_functions
        real(8), intent (in) :: y_s
        real(8), intent (in) :: x
        real(8), intent (in) :: y_m
        real(8), intent (in) :: z
        real(8) :: tmp
        if (x <= 1.45d0) then
            tmp = y_m / (z * x)
        else
            tmp = ((x / z) * y_m) * 0.5d0
        end if
        code = y_s * tmp
    end function
    
    y\_m = Math.abs(y);
    y\_s = Math.copySign(1.0, y);
    public static double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = ((x / z) * y_m) * 0.5;
    	}
    	return y_s * tmp;
    }
    
    y\_m = math.fabs(y)
    y\_s = math.copysign(1.0, y)
    def code(y_s, x, y_m, z):
    	tmp = 0
    	if x <= 1.45:
    		tmp = y_m / (z * x)
    	else:
    		tmp = ((x / z) * y_m) * 0.5
    	return y_s * tmp
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1.45)
    		tmp = Float64(y_m / Float64(z * x));
    	else
    		tmp = Float64(Float64(Float64(x / z) * y_m) * 0.5);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = abs(y);
    y\_s = sign(y) * abs(1.0);
    function tmp_2 = code(y_s, x, y_m, z)
    	tmp = 0.0;
    	if (x <= 1.45)
    		tmp = y_m / (z * x);
    	else
    		tmp = ((x / z) * y_m) * 0.5;
    	end
    	tmp_2 = y_s * tmp;
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.45], N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / z), $MachinePrecision] * y$95$m), $MachinePrecision] * 0.5), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 1.45:\\
    \;\;\;\;\frac{y\_m}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\frac{x}{z} \cdot y\_m\right) \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1.44999999999999996

      1. Initial program 87.4%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6463.8

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

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

      if 1.44999999999999996 < x

      1. Initial program 77.7%

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

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

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

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

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

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        6. lower-/.f64N/A

          \[\leadsto \left(\frac{e^{x} + \frac{1}{e^{x}}}{x \cdot z} \cdot y\right) \cdot \frac{1}{2} \]
        7. rec-expN/A

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

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

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

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

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot \frac{1}{2} \]
        12. lower-*.f6475.6

          \[\leadsto \left(\frac{2 \cdot \cosh x}{z \cdot x} \cdot y\right) \cdot 0.5 \]
      4. Applied rewrites75.6%

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

        \[\leadsto \left(\frac{2 \cdot \frac{1}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \left(\frac{\frac{2 \cdot 1}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        3. metadata-evalN/A

          \[\leadsto \left(\frac{\frac{2}{z} + \frac{{x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        4. div-add-revN/A

          \[\leadsto \left(\frac{\frac{2 + {x}^{2}}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        5. lower-/.f64N/A

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

          \[\leadsto \left(\frac{\frac{{x}^{2} + 2}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        7. pow2N/A

          \[\leadsto \left(\frac{\frac{x \cdot x + 2}{z}}{x} \cdot y\right) \cdot \frac{1}{2} \]
        8. lower-fma.f6466.7

          \[\leadsto \left(\frac{\frac{\mathsf{fma}\left(x, x, 2\right)}{z}}{x} \cdot y\right) \cdot 0.5 \]
      7. Applied rewrites66.7%

        \[\leadsto \left(\frac{\frac{\mathsf{fma}\left(x, x, 2\right)}{z}}{x} \cdot y\right) \cdot 0.5 \]
      8. Taylor expanded in x around inf

        \[\leadsto \left(\frac{x}{z} \cdot y\right) \cdot \frac{1}{2} \]
      9. Step-by-step derivation
        1. lower-/.f6438.3

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

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

    Alternative 13: 57.3% accurate, 1.5× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 1.45:\\ \;\;\;\;\frac{y\_m}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 \cdot \left(y\_m \cdot x\right)}{z}\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (* y_s (if (<= x 1.45) (/ y_m (* z x)) (/ (* 0.5 (* y_m x)) z))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = (0.5 * (y_m * x)) / z;
    	}
    	return y_s * tmp;
    }
    
    y\_m =     private
    y\_s =     private
    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(y_s, x, y_m, z)
    use fmin_fmax_functions
        real(8), intent (in) :: y_s
        real(8), intent (in) :: x
        real(8), intent (in) :: y_m
        real(8), intent (in) :: z
        real(8) :: tmp
        if (x <= 1.45d0) then
            tmp = y_m / (z * x)
        else
            tmp = (0.5d0 * (y_m * x)) / z
        end if
        code = y_s * tmp
    end function
    
    y\_m = Math.abs(y);
    y\_s = Math.copySign(1.0, y);
    public static double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = (0.5 * (y_m * x)) / z;
    	}
    	return y_s * tmp;
    }
    
    y\_m = math.fabs(y)
    y\_s = math.copysign(1.0, y)
    def code(y_s, x, y_m, z):
    	tmp = 0
    	if x <= 1.45:
    		tmp = y_m / (z * x)
    	else:
    		tmp = (0.5 * (y_m * x)) / z
    	return y_s * tmp
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1.45)
    		tmp = Float64(y_m / Float64(z * x));
    	else
    		tmp = Float64(Float64(0.5 * Float64(y_m * x)) / z);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = abs(y);
    y\_s = sign(y) * abs(1.0);
    function tmp_2 = code(y_s, x, y_m, z)
    	tmp = 0.0;
    	if (x <= 1.45)
    		tmp = y_m / (z * x);
    	else
    		tmp = (0.5 * (y_m * x)) / z;
    	end
    	tmp_2 = y_s * tmp;
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.45], N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(y$95$m * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 1.45:\\
    \;\;\;\;\frac{y\_m}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{0.5 \cdot \left(y\_m \cdot x\right)}{z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1.44999999999999996

      1. Initial program 87.4%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6463.8

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

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

      if 1.44999999999999996 < x

      1. Initial program 77.7%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6468.3

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites68.3%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

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

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

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

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

          \[\leadsto \left(x \cdot \frac{y}{z}\right) \cdot \frac{1}{2} \]
        5. lower-/.f6430.9

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

        \[\leadsto \left(x \cdot \frac{y}{z}\right) \cdot \color{blue}{0.5} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

          \[\leadsto \frac{1}{2} \cdot \frac{x \cdot y}{z} \]
        6. associate-*r/N/A

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

          \[\leadsto \frac{\frac{1}{2} \cdot \left(x \cdot y\right)}{z} \]
        8. lower-*.f64N/A

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

          \[\leadsto \frac{\frac{1}{2} \cdot \left(y \cdot x\right)}{z} \]
        10. lower-*.f6439.0

          \[\leadsto \frac{0.5 \cdot \left(y \cdot x\right)}{z} \]
      9. Applied rewrites39.0%

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

    Alternative 14: 55.4% accurate, 1.5× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;x \leq 1.45:\\ \;\;\;\;\frac{y\_m}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \frac{y\_m}{z}\right) \cdot 0.5\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (* y_s (if (<= x 1.45) (/ y_m (* z x)) (* (* x (/ y_m z)) 0.5))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = (x * (y_m / z)) * 0.5;
    	}
    	return y_s * tmp;
    }
    
    y\_m =     private
    y\_s =     private
    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(y_s, x, y_m, z)
    use fmin_fmax_functions
        real(8), intent (in) :: y_s
        real(8), intent (in) :: x
        real(8), intent (in) :: y_m
        real(8), intent (in) :: z
        real(8) :: tmp
        if (x <= 1.45d0) then
            tmp = y_m / (z * x)
        else
            tmp = (x * (y_m / z)) * 0.5d0
        end if
        code = y_s * tmp
    end function
    
    y\_m = Math.abs(y);
    y\_s = Math.copySign(1.0, y);
    public static double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (x <= 1.45) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = (x * (y_m / z)) * 0.5;
    	}
    	return y_s * tmp;
    }
    
    y\_m = math.fabs(y)
    y\_s = math.copysign(1.0, y)
    def code(y_s, x, y_m, z):
    	tmp = 0
    	if x <= 1.45:
    		tmp = y_m / (z * x)
    	else:
    		tmp = (x * (y_m / z)) * 0.5
    	return y_s * tmp
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (x <= 1.45)
    		tmp = Float64(y_m / Float64(z * x));
    	else
    		tmp = Float64(Float64(x * Float64(y_m / z)) * 0.5);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = abs(y);
    y\_s = sign(y) * abs(1.0);
    function tmp_2 = code(y_s, x, y_m, z)
    	tmp = 0.0;
    	if (x <= 1.45)
    		tmp = y_m / (z * x);
    	else
    		tmp = (x * (y_m / z)) * 0.5;
    	end
    	tmp_2 = y_s * tmp;
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[x, 1.45], N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y$95$m / z), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;x \leq 1.45:\\
    \;\;\;\;\frac{y\_m}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(x \cdot \frac{y\_m}{z}\right) \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 1.44999999999999996

      1. Initial program 87.4%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6463.8

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

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

      if 1.44999999999999996 < x

      1. Initial program 77.7%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6468.3

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites68.3%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around inf

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

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

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

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

          \[\leadsto \left(x \cdot \frac{y}{z}\right) \cdot \frac{1}{2} \]
        5. lower-/.f6430.9

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

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

    Alternative 15: 51.7% accurate, 0.7× speedup?

    \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+214}:\\ \;\;\;\;\frac{y\_m}{z \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y\_m}{z}}{x}\\ \end{array} \end{array} \]
    y\_m = (fabs.f64 y)
    y\_s = (copysign.f64 #s(literal 1 binary64) y)
    (FPCore (y_s x y_m z)
     :precision binary64
     (*
      y_s
      (if (<= (/ (* (cosh x) (/ y_m x)) z) 1e+214)
        (/ y_m (* z x))
        (/ (/ y_m z) x))))
    y\_m = fabs(y);
    y\_s = copysign(1.0, y);
    double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (((cosh(x) * (y_m / x)) / z) <= 1e+214) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = (y_m / z) / x;
    	}
    	return y_s * tmp;
    }
    
    y\_m =     private
    y\_s =     private
    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(y_s, x, y_m, z)
    use fmin_fmax_functions
        real(8), intent (in) :: y_s
        real(8), intent (in) :: x
        real(8), intent (in) :: y_m
        real(8), intent (in) :: z
        real(8) :: tmp
        if (((cosh(x) * (y_m / x)) / z) <= 1d+214) then
            tmp = y_m / (z * x)
        else
            tmp = (y_m / z) / x
        end if
        code = y_s * tmp
    end function
    
    y\_m = Math.abs(y);
    y\_s = Math.copySign(1.0, y);
    public static double code(double y_s, double x, double y_m, double z) {
    	double tmp;
    	if (((Math.cosh(x) * (y_m / x)) / z) <= 1e+214) {
    		tmp = y_m / (z * x);
    	} else {
    		tmp = (y_m / z) / x;
    	}
    	return y_s * tmp;
    }
    
    y\_m = math.fabs(y)
    y\_s = math.copysign(1.0, y)
    def code(y_s, x, y_m, z):
    	tmp = 0
    	if ((math.cosh(x) * (y_m / x)) / z) <= 1e+214:
    		tmp = y_m / (z * x)
    	else:
    		tmp = (y_m / z) / x
    	return y_s * tmp
    
    y\_m = abs(y)
    y\_s = copysign(1.0, y)
    function code(y_s, x, y_m, z)
    	tmp = 0.0
    	if (Float64(Float64(cosh(x) * Float64(y_m / x)) / z) <= 1e+214)
    		tmp = Float64(y_m / Float64(z * x));
    	else
    		tmp = Float64(Float64(y_m / z) / x);
    	end
    	return Float64(y_s * tmp)
    end
    
    y\_m = abs(y);
    y\_s = sign(y) * abs(1.0);
    function tmp_2 = code(y_s, x, y_m, z)
    	tmp = 0.0;
    	if (((cosh(x) * (y_m / x)) / z) <= 1e+214)
    		tmp = y_m / (z * x);
    	else
    		tmp = (y_m / z) / x;
    	end
    	tmp_2 = y_s * tmp;
    end
    
    y\_m = N[Abs[y], $MachinePrecision]
    y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * If[LessEqual[N[(N[(N[Cosh[x], $MachinePrecision] * N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], 1e+214], N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision], N[(N[(y$95$m / z), $MachinePrecision] / x), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    y\_m = \left|y\right|
    \\
    y\_s = \mathsf{copysign}\left(1, y\right)
    
    \\
    y\_s \cdot \begin{array}{l}
    \mathbf{if}\;\frac{\cosh x \cdot \frac{y\_m}{x}}{z} \leq 10^{+214}:\\
    \;\;\;\;\frac{y\_m}{z \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{y\_m}{z}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 9.9999999999999995e213

      1. Initial program 96.4%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6463.1

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

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

      if 9.9999999999999995e213 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z)

      1. Initial program 68.5%

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

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

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

          \[\leadsto \frac{\frac{\frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z} + \frac{y}{z}}{x} \]
        3. div-add-revN/A

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

          \[\leadsto \frac{\frac{y + \frac{1}{2} \cdot \left({x}^{2} \cdot y\right)}{z}}{x} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \frac{\frac{\left({x}^{2} \cdot y\right) \cdot \frac{1}{2} + y}{z}}{x} \]
        8. lower-fma.f64N/A

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

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

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, \frac{1}{2}, y\right)}{z}}{x} \]
        11. lower-*.f6478.6

          \[\leadsto \frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x} \]
      4. Applied rewrites78.6%

        \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot y, 0.5, y\right)}{z}}{x}} \]
      5. Taylor expanded in x around 0

        \[\leadsto \frac{\frac{y}{z}}{x} \]
      6. Step-by-step derivation
        1. Applied rewrites35.4%

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

      Alternative 16: 48.9% accurate, 2.9× speedup?

      \[\begin{array}{l} y\_m = \left|y\right| \\ y\_s = \mathsf{copysign}\left(1, y\right) \\ y\_s \cdot \frac{y\_m}{z \cdot x} \end{array} \]
      y\_m = (fabs.f64 y)
      y\_s = (copysign.f64 #s(literal 1 binary64) y)
      (FPCore (y_s x y_m z) :precision binary64 (* y_s (/ y_m (* z x))))
      y\_m = fabs(y);
      y\_s = copysign(1.0, y);
      double code(double y_s, double x, double y_m, double z) {
      	return y_s * (y_m / (z * x));
      }
      
      y\_m =     private
      y\_s =     private
      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(y_s, x, y_m, z)
      use fmin_fmax_functions
          real(8), intent (in) :: y_s
          real(8), intent (in) :: x
          real(8), intent (in) :: y_m
          real(8), intent (in) :: z
          code = y_s * (y_m / (z * x))
      end function
      
      y\_m = Math.abs(y);
      y\_s = Math.copySign(1.0, y);
      public static double code(double y_s, double x, double y_m, double z) {
      	return y_s * (y_m / (z * x));
      }
      
      y\_m = math.fabs(y)
      y\_s = math.copysign(1.0, y)
      def code(y_s, x, y_m, z):
      	return y_s * (y_m / (z * x))
      
      y\_m = abs(y)
      y\_s = copysign(1.0, y)
      function code(y_s, x, y_m, z)
      	return Float64(y_s * Float64(y_m / Float64(z * x)))
      end
      
      y\_m = abs(y);
      y\_s = sign(y) * abs(1.0);
      function tmp = code(y_s, x, y_m, z)
      	tmp = y_s * (y_m / (z * x));
      end
      
      y\_m = N[Abs[y], $MachinePrecision]
      y\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[y$95$s_, x_, y$95$m_, z_] := N[(y$95$s * N[(y$95$m / N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      y\_m = \left|y\right|
      \\
      y\_s = \mathsf{copysign}\left(1, y\right)
      
      \\
      y\_s \cdot \frac{y\_m}{z \cdot x}
      \end{array}
      
      Derivation
      1. Initial program 84.9%

        \[\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. *-commutativeN/A

          \[\leadsto \frac{y}{z \cdot \color{blue}{x}} \]
        3. lower-*.f6448.9

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

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

      Reproduce

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