(/ z0 (* (* (sinh (/ 1 z1)) (+ z1 z1)) (exp (/ (* z3 z2) z1))))

Percentage Accurate: 99.5% → 99.5%
Time: 3.3s
Alternatives: 10
Speedup: 1.7×

Specification

?
\[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
(FPCore (z0 z1 z3 z2)
  :precision binary64
  (/ z0 (* (* (sinh (/ 1.0 z1)) (+ z1 z1)) (exp (/ (* z3 z2) z1)))))
double code(double z0, double z1, double z3, double z2) {
	return z0 / ((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)));
}
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(z0, z1, z3, z2)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    real(8), intent (in) :: z1
    real(8), intent (in) :: z3
    real(8), intent (in) :: z2
    code = z0 / ((sinh((1.0d0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)))
end function
public static double code(double z0, double z1, double z3, double z2) {
	return z0 / ((Math.sinh((1.0 / z1)) * (z1 + z1)) * Math.exp(((z3 * z2) / z1)));
}
def code(z0, z1, z3, z2):
	return z0 / ((math.sinh((1.0 / z1)) * (z1 + z1)) * math.exp(((z3 * z2) / z1)))
function code(z0, z1, z3, z2)
	return Float64(z0 / Float64(Float64(sinh(Float64(1.0 / z1)) * Float64(z1 + z1)) * exp(Float64(Float64(z3 * z2) / z1))))
end
function tmp = code(z0, z1, z3, z2)
	tmp = z0 / ((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)));
end
code[z0_, z1_, z3_, z2_] := N[(z0 / N[(N[(N[Sinh[N[(1.0 / z1), $MachinePrecision]], $MachinePrecision] * N[(z1 + z1), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(z3 * z2), $MachinePrecision] / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}}

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 10 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: 99.5% accurate, 1.0× speedup?

\[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
(FPCore (z0 z1 z3 z2)
  :precision binary64
  (/ z0 (* (* (sinh (/ 1.0 z1)) (+ z1 z1)) (exp (/ (* z3 z2) z1)))))
double code(double z0, double z1, double z3, double z2) {
	return z0 / ((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)));
}
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(z0, z1, z3, z2)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    real(8), intent (in) :: z1
    real(8), intent (in) :: z3
    real(8), intent (in) :: z2
    code = z0 / ((sinh((1.0d0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)))
end function
public static double code(double z0, double z1, double z3, double z2) {
	return z0 / ((Math.sinh((1.0 / z1)) * (z1 + z1)) * Math.exp(((z3 * z2) / z1)));
}
def code(z0, z1, z3, z2):
	return z0 / ((math.sinh((1.0 / z1)) * (z1 + z1)) * math.exp(((z3 * z2) / z1)))
function code(z0, z1, z3, z2)
	return Float64(z0 / Float64(Float64(sinh(Float64(1.0 / z1)) * Float64(z1 + z1)) * exp(Float64(Float64(z3 * z2) / z1))))
end
function tmp = code(z0, z1, z3, z2)
	tmp = z0 / ((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)));
end
code[z0_, z1_, z3_, z2_] := N[(z0 / N[(N[(N[Sinh[N[(1.0 / z1), $MachinePrecision]], $MachinePrecision] * N[(z1 + z1), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(z3 * z2), $MachinePrecision] / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}}

Alternative 1: 99.5% accurate, 1.7× speedup?

\[\begin{array}{l} t_0 := \frac{z3 \cdot z2}{z1}\\ \mathbf{if}\;z1 \leq -9.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{e^{-t\_0}}{2} \cdot z0\\ \mathbf{elif}\;z1 \leq 0.00135:\\ \;\;\;\;\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z0}{2 \cdot e^{t\_0}}\\ \end{array} \]
(FPCore (z0 z1 z3 z2)
  :precision binary64
  (let* ((t_0 (/ (* z3 z2) z1)))
  (if (<= z1 -9.2e+14)
    (* (/ (exp (- t_0)) 2.0) z0)
    (if (<= z1 0.00135)
      (/ z0 (* (* (sinh (/ 1.0 z1)) (+ z1 z1)) 1.0))
      (/ z0 (* 2.0 (exp t_0)))))))
double code(double z0, double z1, double z3, double z2) {
	double t_0 = (z3 * z2) / z1;
	double tmp;
	if (z1 <= -9.2e+14) {
		tmp = (exp(-t_0) / 2.0) * z0;
	} else if (z1 <= 0.00135) {
		tmp = z0 / ((sinh((1.0 / z1)) * (z1 + z1)) * 1.0);
	} else {
		tmp = z0 / (2.0 * exp(t_0));
	}
	return tmp;
}
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(z0, z1, z3, z2)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    real(8), intent (in) :: z1
    real(8), intent (in) :: z3
    real(8), intent (in) :: z2
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (z3 * z2) / z1
    if (z1 <= (-9.2d+14)) then
        tmp = (exp(-t_0) / 2.0d0) * z0
    else if (z1 <= 0.00135d0) then
        tmp = z0 / ((sinh((1.0d0 / z1)) * (z1 + z1)) * 1.0d0)
    else
        tmp = z0 / (2.0d0 * exp(t_0))
    end if
    code = tmp
end function
public static double code(double z0, double z1, double z3, double z2) {
	double t_0 = (z3 * z2) / z1;
	double tmp;
	if (z1 <= -9.2e+14) {
		tmp = (Math.exp(-t_0) / 2.0) * z0;
	} else if (z1 <= 0.00135) {
		tmp = z0 / ((Math.sinh((1.0 / z1)) * (z1 + z1)) * 1.0);
	} else {
		tmp = z0 / (2.0 * Math.exp(t_0));
	}
	return tmp;
}
def code(z0, z1, z3, z2):
	t_0 = (z3 * z2) / z1
	tmp = 0
	if z1 <= -9.2e+14:
		tmp = (math.exp(-t_0) / 2.0) * z0
	elif z1 <= 0.00135:
		tmp = z0 / ((math.sinh((1.0 / z1)) * (z1 + z1)) * 1.0)
	else:
		tmp = z0 / (2.0 * math.exp(t_0))
	return tmp
function code(z0, z1, z3, z2)
	t_0 = Float64(Float64(z3 * z2) / z1)
	tmp = 0.0
	if (z1 <= -9.2e+14)
		tmp = Float64(Float64(exp(Float64(-t_0)) / 2.0) * z0);
	elseif (z1 <= 0.00135)
		tmp = Float64(z0 / Float64(Float64(sinh(Float64(1.0 / z1)) * Float64(z1 + z1)) * 1.0));
	else
		tmp = Float64(z0 / Float64(2.0 * exp(t_0)));
	end
	return tmp
end
function tmp_2 = code(z0, z1, z3, z2)
	t_0 = (z3 * z2) / z1;
	tmp = 0.0;
	if (z1 <= -9.2e+14)
		tmp = (exp(-t_0) / 2.0) * z0;
	elseif (z1 <= 0.00135)
		tmp = z0 / ((sinh((1.0 / z1)) * (z1 + z1)) * 1.0);
	else
		tmp = z0 / (2.0 * exp(t_0));
	end
	tmp_2 = tmp;
end
code[z0_, z1_, z3_, z2_] := Block[{t$95$0 = N[(N[(z3 * z2), $MachinePrecision] / z1), $MachinePrecision]}, If[LessEqual[z1, -9.2e+14], N[(N[(N[Exp[(-t$95$0)], $MachinePrecision] / 2.0), $MachinePrecision] * z0), $MachinePrecision], If[LessEqual[z1, 0.00135], N[(z0 / N[(N[(N[Sinh[N[(1.0 / z1), $MachinePrecision]], $MachinePrecision] * N[(z1 + z1), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(z0 / N[(2.0 * N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{z3 \cdot z2}{z1}\\
\mathbf{if}\;z1 \leq -9.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{e^{-t\_0}}{2} \cdot z0\\

\mathbf{elif}\;z1 \leq 0.00135:\\
\;\;\;\;\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{z0}{2 \cdot e^{t\_0}}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z1 < -9.2e14

    1. Initial program 99.5%

      \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
    2. Taylor expanded in z1 around inf

      \[\leadsto \frac{z0}{\color{blue}{2} \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
    3. Step-by-step derivation
      1. Applied rewrites81.8%

        \[\leadsto \frac{z0}{\color{blue}{2} \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
      2. Step-by-step derivation
        1. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{z0}{2 \cdot e^{\frac{z3 \cdot z2}{z1}}}} \]
        2. mult-flipN/A

          \[\leadsto \color{blue}{z0 \cdot \frac{1}{2 \cdot e^{\frac{z3 \cdot z2}{z1}}}} \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{1}{2 \cdot e^{\frac{z3 \cdot z2}{z1}}} \cdot z0} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{1}{2 \cdot e^{\frac{z3 \cdot z2}{z1}}} \cdot z0} \]
      3. Applied rewrites81.8%

        \[\leadsto \color{blue}{\frac{e^{-\frac{z3 \cdot z2}{z1}}}{2} \cdot z0} \]

      if -9.2e14 < z1 < 0.0013500000000000001

      1. Initial program 99.5%

        \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
      2. Taylor expanded in z1 around inf

        \[\leadsto \frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot \color{blue}{1}} \]
      3. Step-by-step derivation
        1. Applied rewrites89.4%

          \[\leadsto \frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot \color{blue}{1}} \]

        if 0.0013500000000000001 < z1

        1. Initial program 99.5%

          \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
        2. Taylor expanded in z1 around inf

          \[\leadsto \frac{z0}{\color{blue}{2} \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
        3. Step-by-step derivation
          1. Applied rewrites81.8%

            \[\leadsto \frac{z0}{\color{blue}{2} \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
        4. Recombined 3 regimes into one program.
        5. Add Preprocessing

        Alternative 2: 99.5% accurate, 1.0× speedup?

        \[\frac{z0}{\sinh \left(\frac{-1}{z1}\right) \cdot \left(z1 + z1\right)} \cdot \frac{-1}{e^{\frac{z2 \cdot z3}{z1}}} \]
        (FPCore (z0 z1 z3 z2)
          :precision binary64
          (*
         (/ z0 (* (sinh (/ -1.0 z1)) (+ z1 z1)))
         (/ -1.0 (exp (/ (* z2 z3) z1)))))
        double code(double z0, double z1, double z3, double z2) {
        	return (z0 / (sinh((-1.0 / z1)) * (z1 + z1))) * (-1.0 / exp(((z2 * z3) / z1)));
        }
        
        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(z0, z1, z3, z2)
        use fmin_fmax_functions
            real(8), intent (in) :: z0
            real(8), intent (in) :: z1
            real(8), intent (in) :: z3
            real(8), intent (in) :: z2
            code = (z0 / (sinh(((-1.0d0) / z1)) * (z1 + z1))) * ((-1.0d0) / exp(((z2 * z3) / z1)))
        end function
        
        public static double code(double z0, double z1, double z3, double z2) {
        	return (z0 / (Math.sinh((-1.0 / z1)) * (z1 + z1))) * (-1.0 / Math.exp(((z2 * z3) / z1)));
        }
        
        def code(z0, z1, z3, z2):
        	return (z0 / (math.sinh((-1.0 / z1)) * (z1 + z1))) * (-1.0 / math.exp(((z2 * z3) / z1)))
        
        function code(z0, z1, z3, z2)
        	return Float64(Float64(z0 / Float64(sinh(Float64(-1.0 / z1)) * Float64(z1 + z1))) * Float64(-1.0 / exp(Float64(Float64(z2 * z3) / z1))))
        end
        
        function tmp = code(z0, z1, z3, z2)
        	tmp = (z0 / (sinh((-1.0 / z1)) * (z1 + z1))) * (-1.0 / exp(((z2 * z3) / z1)));
        end
        
        code[z0_, z1_, z3_, z2_] := N[(N[(z0 / N[(N[Sinh[N[(-1.0 / z1), $MachinePrecision]], $MachinePrecision] * N[(z1 + z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[Exp[N[(N[(z2 * z3), $MachinePrecision] / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \frac{z0}{\sinh \left(\frac{-1}{z1}\right) \cdot \left(z1 + z1\right)} \cdot \frac{-1}{e^{\frac{z2 \cdot z3}{z1}}}
        
        Derivation
        1. Initial program 99.5%

          \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
        2. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{z0}{\color{blue}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}}} \]
          3. associate-/r*N/A

            \[\leadsto \color{blue}{\frac{\frac{z0}{\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)}}{e^{\frac{z3 \cdot z2}{z1}}}} \]
          4. frac-2negN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{z0}{\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)}\right)}{\mathsf{neg}\left(e^{\frac{z3 \cdot z2}{z1}}\right)}} \]
          5. mult-flipN/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{z0}{\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(e^{\frac{z3 \cdot z2}{z1}}\right)}} \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{z0}{\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(e^{\frac{z3 \cdot z2}{z1}}\right)}} \]
        3. Applied rewrites99.5%

          \[\leadsto \color{blue}{\frac{z0}{\sinh \left(\frac{-1}{z1}\right) \cdot \left(z1 + z1\right)} \cdot \frac{-1}{e^{\frac{z2 \cdot z3}{z1}}}} \]
        4. Add Preprocessing

        Alternative 3: 81.8% accurate, 1.9× speedup?

        \[\frac{z0}{2 \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
        (FPCore (z0 z1 z3 z2)
          :precision binary64
          (/ z0 (* 2.0 (exp (/ (* z3 z2) z1)))))
        double code(double z0, double z1, double z3, double z2) {
        	return z0 / (2.0 * exp(((z3 * z2) / z1)));
        }
        
        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(z0, z1, z3, z2)
        use fmin_fmax_functions
            real(8), intent (in) :: z0
            real(8), intent (in) :: z1
            real(8), intent (in) :: z3
            real(8), intent (in) :: z2
            code = z0 / (2.0d0 * exp(((z3 * z2) / z1)))
        end function
        
        public static double code(double z0, double z1, double z3, double z2) {
        	return z0 / (2.0 * Math.exp(((z3 * z2) / z1)));
        }
        
        def code(z0, z1, z3, z2):
        	return z0 / (2.0 * math.exp(((z3 * z2) / z1)))
        
        function code(z0, z1, z3, z2)
        	return Float64(z0 / Float64(2.0 * exp(Float64(Float64(z3 * z2) / z1))))
        end
        
        function tmp = code(z0, z1, z3, z2)
        	tmp = z0 / (2.0 * exp(((z3 * z2) / z1)));
        end
        
        code[z0_, z1_, z3_, z2_] := N[(z0 / N[(2.0 * N[Exp[N[(N[(z3 * z2), $MachinePrecision] / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \frac{z0}{2 \cdot e^{\frac{z3 \cdot z2}{z1}}}
        
        Derivation
        1. Initial program 99.5%

          \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
        2. Taylor expanded in z1 around inf

          \[\leadsto \frac{z0}{\color{blue}{2} \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
        3. Step-by-step derivation
          1. Applied rewrites81.8%

            \[\leadsto \frac{z0}{\color{blue}{2} \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
          2. Add Preprocessing

          Alternative 4: 68.2% accurate, 0.2× speedup?

          \[\begin{array}{l} t_0 := \mathsf{min}\left(z3, z2\right) + \mathsf{min}\left(z3, z2\right)\\ t_1 := \left(\mathsf{min}\left(z3, z2\right) \cdot \mathsf{max}\left(z3, z2\right)\right) \cdot z1\\ t_2 := \frac{\mathsf{max}\left(z3, z2\right)}{z1} \cdot t\_0\\ \mathbf{if}\;z1 \leq -1.2 \cdot 10^{+168}:\\ \;\;\;\;\frac{z0}{2 + \frac{t\_0 \cdot \mathsf{max}\left(z3, z2\right)}{z1}}\\ \mathbf{elif}\;z1 \leq 2.5 \cdot 10^{-135}:\\ \;\;\;\;\frac{z0}{2 + \frac{t\_1 + t\_1}{z1 \cdot z1}}\\ \mathbf{elif}\;z1 \leq 9.2 \cdot 10^{-67}:\\ \;\;\;\;\frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(\mathsf{max}\left(z3, z2\right) \cdot \mathsf{min}\left(z3, z2\right)\right)\right)\right)}{z1 \cdot z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z0}{\frac{t\_2 \cdot t\_2 - 2 \cdot 2}{t\_2 - 2}}\\ \end{array} \]
          (FPCore (z0 z1 z3 z2)
            :precision binary64
            (let* ((t_0 (+ (fmin z3 z2) (fmin z3 z2)))
                 (t_1 (* (* (fmin z3 z2) (fmax z3 z2)) z1))
                 (t_2 (* (/ (fmax z3 z2) z1) t_0)))
            (if (<= z1 -1.2e+168)
              (/ z0 (+ 2.0 (/ (* t_0 (fmax z3 z2)) z1)))
              (if (<= z1 2.5e-135)
                (/ z0 (+ 2.0 (/ (+ t_1 t_1) (* z1 z1))))
                (if (<= z1 9.2e-67)
                  (/
                   (* -0.5 (* z0 (* z1 (* (fmax z3 z2) (fmin z3 z2)))))
                   (* z1 z1))
                  (/ z0 (/ (- (* t_2 t_2) (* 2.0 2.0)) (- t_2 2.0))))))))
          double code(double z0, double z1, double z3, double z2) {
          	double t_0 = fmin(z3, z2) + fmin(z3, z2);
          	double t_1 = (fmin(z3, z2) * fmax(z3, z2)) * z1;
          	double t_2 = (fmax(z3, z2) / z1) * t_0;
          	double tmp;
          	if (z1 <= -1.2e+168) {
          		tmp = z0 / (2.0 + ((t_0 * fmax(z3, z2)) / z1));
          	} else if (z1 <= 2.5e-135) {
          		tmp = z0 / (2.0 + ((t_1 + t_1) / (z1 * z1)));
          	} else if (z1 <= 9.2e-67) {
          		tmp = (-0.5 * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1);
          	} else {
          		tmp = z0 / (((t_2 * t_2) - (2.0 * 2.0)) / (t_2 - 2.0));
          	}
          	return tmp;
          }
          
          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(z0, z1, z3, z2)
          use fmin_fmax_functions
              real(8), intent (in) :: z0
              real(8), intent (in) :: z1
              real(8), intent (in) :: z3
              real(8), intent (in) :: z2
              real(8) :: t_0
              real(8) :: t_1
              real(8) :: t_2
              real(8) :: tmp
              t_0 = fmin(z3, z2) + fmin(z3, z2)
              t_1 = (fmin(z3, z2) * fmax(z3, z2)) * z1
              t_2 = (fmax(z3, z2) / z1) * t_0
              if (z1 <= (-1.2d+168)) then
                  tmp = z0 / (2.0d0 + ((t_0 * fmax(z3, z2)) / z1))
              else if (z1 <= 2.5d-135) then
                  tmp = z0 / (2.0d0 + ((t_1 + t_1) / (z1 * z1)))
              else if (z1 <= 9.2d-67) then
                  tmp = ((-0.5d0) * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1)
              else
                  tmp = z0 / (((t_2 * t_2) - (2.0d0 * 2.0d0)) / (t_2 - 2.0d0))
              end if
              code = tmp
          end function
          
          public static double code(double z0, double z1, double z3, double z2) {
          	double t_0 = fmin(z3, z2) + fmin(z3, z2);
          	double t_1 = (fmin(z3, z2) * fmax(z3, z2)) * z1;
          	double t_2 = (fmax(z3, z2) / z1) * t_0;
          	double tmp;
          	if (z1 <= -1.2e+168) {
          		tmp = z0 / (2.0 + ((t_0 * fmax(z3, z2)) / z1));
          	} else if (z1 <= 2.5e-135) {
          		tmp = z0 / (2.0 + ((t_1 + t_1) / (z1 * z1)));
          	} else if (z1 <= 9.2e-67) {
          		tmp = (-0.5 * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1);
          	} else {
          		tmp = z0 / (((t_2 * t_2) - (2.0 * 2.0)) / (t_2 - 2.0));
          	}
          	return tmp;
          }
          
          def code(z0, z1, z3, z2):
          	t_0 = fmin(z3, z2) + fmin(z3, z2)
          	t_1 = (fmin(z3, z2) * fmax(z3, z2)) * z1
          	t_2 = (fmax(z3, z2) / z1) * t_0
          	tmp = 0
          	if z1 <= -1.2e+168:
          		tmp = z0 / (2.0 + ((t_0 * fmax(z3, z2)) / z1))
          	elif z1 <= 2.5e-135:
          		tmp = z0 / (2.0 + ((t_1 + t_1) / (z1 * z1)))
          	elif z1 <= 9.2e-67:
          		tmp = (-0.5 * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1)
          	else:
          		tmp = z0 / (((t_2 * t_2) - (2.0 * 2.0)) / (t_2 - 2.0))
          	return tmp
          
          function code(z0, z1, z3, z2)
          	t_0 = Float64(fmin(z3, z2) + fmin(z3, z2))
          	t_1 = Float64(Float64(fmin(z3, z2) * fmax(z3, z2)) * z1)
          	t_2 = Float64(Float64(fmax(z3, z2) / z1) * t_0)
          	tmp = 0.0
          	if (z1 <= -1.2e+168)
          		tmp = Float64(z0 / Float64(2.0 + Float64(Float64(t_0 * fmax(z3, z2)) / z1)));
          	elseif (z1 <= 2.5e-135)
          		tmp = Float64(z0 / Float64(2.0 + Float64(Float64(t_1 + t_1) / Float64(z1 * z1))));
          	elseif (z1 <= 9.2e-67)
          		tmp = Float64(Float64(-0.5 * Float64(z0 * Float64(z1 * Float64(fmax(z3, z2) * fmin(z3, z2))))) / Float64(z1 * z1));
          	else
          		tmp = Float64(z0 / Float64(Float64(Float64(t_2 * t_2) - Float64(2.0 * 2.0)) / Float64(t_2 - 2.0)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(z0, z1, z3, z2)
          	t_0 = min(z3, z2) + min(z3, z2);
          	t_1 = (min(z3, z2) * max(z3, z2)) * z1;
          	t_2 = (max(z3, z2) / z1) * t_0;
          	tmp = 0.0;
          	if (z1 <= -1.2e+168)
          		tmp = z0 / (2.0 + ((t_0 * max(z3, z2)) / z1));
          	elseif (z1 <= 2.5e-135)
          		tmp = z0 / (2.0 + ((t_1 + t_1) / (z1 * z1)));
          	elseif (z1 <= 9.2e-67)
          		tmp = (-0.5 * (z0 * (z1 * (max(z3, z2) * min(z3, z2))))) / (z1 * z1);
          	else
          		tmp = z0 / (((t_2 * t_2) - (2.0 * 2.0)) / (t_2 - 2.0));
          	end
          	tmp_2 = tmp;
          end
          
          code[z0_, z1_, z3_, z2_] := Block[{t$95$0 = N[(N[Min[z3, z2], $MachinePrecision] + N[Min[z3, z2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Min[z3, z2], $MachinePrecision] * N[Max[z3, z2], $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Max[z3, z2], $MachinePrecision] / z1), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[z1, -1.2e+168], N[(z0 / N[(2.0 + N[(N[(t$95$0 * N[Max[z3, z2], $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z1, 2.5e-135], N[(z0 / N[(2.0 + N[(N[(t$95$1 + t$95$1), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z1, 9.2e-67], N[(N[(-0.5 * N[(z0 * N[(z1 * N[(N[Max[z3, z2], $MachinePrecision] * N[Min[z3, z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision], N[(z0 / N[(N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(2.0 * 2.0), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
          
          \begin{array}{l}
          t_0 := \mathsf{min}\left(z3, z2\right) + \mathsf{min}\left(z3, z2\right)\\
          t_1 := \left(\mathsf{min}\left(z3, z2\right) \cdot \mathsf{max}\left(z3, z2\right)\right) \cdot z1\\
          t_2 := \frac{\mathsf{max}\left(z3, z2\right)}{z1} \cdot t\_0\\
          \mathbf{if}\;z1 \leq -1.2 \cdot 10^{+168}:\\
          \;\;\;\;\frac{z0}{2 + \frac{t\_0 \cdot \mathsf{max}\left(z3, z2\right)}{z1}}\\
          
          \mathbf{elif}\;z1 \leq 2.5 \cdot 10^{-135}:\\
          \;\;\;\;\frac{z0}{2 + \frac{t\_1 + t\_1}{z1 \cdot z1}}\\
          
          \mathbf{elif}\;z1 \leq 9.2 \cdot 10^{-67}:\\
          \;\;\;\;\frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(\mathsf{max}\left(z3, z2\right) \cdot \mathsf{min}\left(z3, z2\right)\right)\right)\right)}{z1 \cdot z1}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{z0}{\frac{t\_2 \cdot t\_2 - 2 \cdot 2}{t\_2 - 2}}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if z1 < -1.2e168

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              4. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}} \]
            4. Applied rewrites66.6%

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              2. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              3. associate-*r/N/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z2 \cdot z3\right)}{\color{blue}{z1}}} \]
              4. div-flipN/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z2 \cdot z3\right)}}}} \]
              5. lower-unsound-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z2 \cdot z3\right)}}}} \]
              6. lower-unsound-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{\color{blue}{2 \cdot \left(z2 \cdot z3\right)}}}} \]
              7. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \color{blue}{\left(z2 \cdot z3\right)}}}} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \left(z2 \cdot \color{blue}{z3}\right)}}} \]
              9. *-commutativeN/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \left(z3 \cdot \color{blue}{z2}\right)}}} \]
              10. lift-*.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \left(z3 \cdot \color{blue}{z2}\right)}}} \]
            6. Applied rewrites66.6%

              \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z3 \cdot z2\right)}}}} \]
            7. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z3 \cdot z2\right)}}}} \]
              2. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{\color{blue}{2 \cdot \left(z3 \cdot z2\right)}}}} \]
              3. div-flip-revN/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{\color{blue}{z1}}} \]
              4. lower-/.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{\color{blue}{z1}}} \]
              5. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{z1}} \]
              6. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{z1}} \]
              7. associate-*r*N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(2 \cdot z3\right) \cdot z2}{z1}} \]
              8. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(2 \cdot z3\right) \cdot z2}{z1}} \]
              9. count-2-revN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 + z3\right) \cdot z2}{z1}} \]
              10. lower-+.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 + z3\right) \cdot z2}{z1}} \]
            8. Applied rewrites66.6%

              \[\leadsto \frac{z0}{2 + \frac{\left(z3 + z3\right) \cdot z2}{\color{blue}{z1}}} \]

            if -1.2e168 < z1 < 2.5000000000000001e-135

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              4. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}} \]
            4. Applied rewrites66.6%

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              2. count-2-revN/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \color{blue}{\frac{z2 \cdot z3}{z1}}\right)} \]
              3. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{\color{blue}{z2 \cdot z3}}{z1}\right)} \]
              4. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{z2 \cdot z3}{\color{blue}{z1}}\right)} \]
              5. common-denominatorN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{\color{blue}{z1 \cdot z1}}} \]
              6. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{\color{blue}{z1 \cdot z1}}} \]
              7. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{\color{blue}{z1} \cdot z1}} \]
              8. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              9. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              10. *-commutativeN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              11. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              12. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              13. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              14. *-commutativeN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{z1 \cdot z1}} \]
              15. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{z1 \cdot z1}} \]
              16. lower-*.f6460.4%

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{z1 \cdot \color{blue}{z1}}} \]
            6. Applied rewrites60.4%

              \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{\color{blue}{z1 \cdot z1}}} \]

            if 2.5000000000000001e-135 < z1 < 9.2000000000000002e-67

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2}} \cdot z0 \]
              3. lower-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              4. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              5. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              6. lower-*.f6447.1%

                \[\leadsto -0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot \color{blue}{z0} \]
            4. Applied rewrites47.1%

              \[\leadsto \color{blue}{-0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot z0} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot \color{blue}{z0} \]
              3. fp-cancel-sign-sub-invN/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot z0} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot z0 \]
              5. metadata-evalN/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \frac{-1}{2} \cdot z0 \]
              6. distribute-lft-out--N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right)} \]
              8. lower--.f6447.1%

                \[\leadsto -0.5 \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{z0}\right) \]
              9. lift-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right) \]
              10. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right) \]
              11. associate-/l*N/A

                \[\leadsto \frac{-1}{2} \cdot \left(z0 \cdot \frac{z2 \cdot z3}{z1} - z0\right) \]
              12. lift-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(z0 \cdot \frac{z2 \cdot z3}{z1} - z0\right) \]
              13. *-commutativeN/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              14. lower-*.f6449.1%

                \[\leadsto -0.5 \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              15. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              16. *-commutativeN/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
              17. lift-*.f6449.1%

                \[\leadsto -0.5 \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
            6. Applied rewrites49.1%

              \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right)} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right)} \]
              2. lift--.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - \color{blue}{z0}\right) \]
              3. distribute-rgt-out--N/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} - \color{blue}{z0 \cdot \frac{-1}{2}} \]
              4. lift-*.f64N/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} - \color{blue}{z0} \cdot \frac{-1}{2} \]
              5. *-commutativeN/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} - \frac{-1}{2} \cdot \color{blue}{z0} \]
              6. fp-cancel-sub-sign-invN/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot z0} \]
              7. metadata-evalN/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} + \frac{1}{2} \cdot z0 \]
              8. lift-*.f64N/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} + \frac{1}{2} \cdot \color{blue}{z0} \]
              9. +-commutativeN/A

                \[\leadsto \frac{1}{2} \cdot z0 + \color{blue}{\left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2}} \]
              10. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \color{blue}{\frac{-1}{2}} \]
              11. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} \]
              12. lift-/.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} \]
              13. associate-*l/N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(z3 \cdot z2\right) \cdot z0}{z1} \cdot \frac{-1}{2} \]
              14. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(z3 \cdot z2\right) \cdot z0}{z1} \cdot \frac{-1}{2} \]
              15. associate-*l/N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{\color{blue}{z1}} \]
              16. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              17. add-to-fraction-revN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{\color{blue}{z1}} \]
              18. lift-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
            8. Applied rewrites20.7%

              \[\leadsto \frac{\left(\left(0.5 \cdot z0\right) \cdot z1\right) \cdot z1 - z1 \cdot \left(\left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot 0.5\right)}{\color{blue}{z1 \cdot z1}} \]
            9. Taylor expanded in z1 around 0

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{\color{blue}{z1} \cdot z1} \]
            10. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
              3. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
              4. lower-*.f6411.0%

                \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
            11. Applied rewrites11.0%

              \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{\color{blue}{z1} \cdot z1} \]

            if 9.2000000000000002e-67 < z1

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              4. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}} \]
            4. Applied rewrites66.6%

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
              2. +-commutativeN/A

                \[\leadsto \frac{z0}{2 \cdot \frac{z2 \cdot z3}{z1} + \color{blue}{2}} \]
              3. flip-+N/A

                \[\leadsto \frac{z0}{\frac{\left(2 \cdot \frac{z2 \cdot z3}{z1}\right) \cdot \left(2 \cdot \frac{z2 \cdot z3}{z1}\right) - 2 \cdot 2}{\color{blue}{2 \cdot \frac{z2 \cdot z3}{z1} - 2}}} \]
              4. lower-unsound-/.f64N/A

                \[\leadsto \frac{z0}{\frac{\left(2 \cdot \frac{z2 \cdot z3}{z1}\right) \cdot \left(2 \cdot \frac{z2 \cdot z3}{z1}\right) - 2 \cdot 2}{\color{blue}{2 \cdot \frac{z2 \cdot z3}{z1} - 2}}} \]
            6. Applied rewrites58.1%

              \[\leadsto \frac{z0}{\frac{\left(\frac{z2}{z1} \cdot \left(z3 + z3\right)\right) \cdot \left(\frac{z2}{z1} \cdot \left(z3 + z3\right)\right) - 2 \cdot 2}{\color{blue}{\frac{z2}{z1} \cdot \left(z3 + z3\right) - 2}}} \]
          3. Recombined 4 regimes into one program.
          4. Add Preprocessing

          Alternative 5: 68.1% accurate, 0.5× speedup?

          \[\begin{array}{l} t_0 := \left(\mathsf{min}\left(z3, z2\right) \cdot \mathsf{max}\left(z3, z2\right)\right) \cdot z1\\ \mathbf{if}\;z1 \leq -1.2 \cdot 10^{+168}:\\ \;\;\;\;\frac{z0}{2 + \frac{\left(\mathsf{min}\left(z3, z2\right) + \mathsf{min}\left(z3, z2\right)\right) \cdot \mathsf{max}\left(z3, z2\right)}{z1}}\\ \mathbf{elif}\;z1 \leq 2.5 \cdot 10^{-135}:\\ \;\;\;\;\frac{z0}{2 + \frac{t\_0 + t\_0}{z1 \cdot z1}}\\ \mathbf{elif}\;z1 \leq 8.2 \cdot 10^{-78}:\\ \;\;\;\;\frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(\mathsf{max}\left(z3, z2\right) \cdot \mathsf{min}\left(z3, z2\right)\right)\right)\right)}{z1 \cdot z1}\\ \mathbf{else}:\\ \;\;\;\;\frac{z0}{2 + \frac{\mathsf{min}\left(z3, z2\right)}{z1} \cdot \left(\mathsf{max}\left(z3, z2\right) + \mathsf{max}\left(z3, z2\right)\right)}\\ \end{array} \]
          (FPCore (z0 z1 z3 z2)
            :precision binary64
            (let* ((t_0 (* (* (fmin z3 z2) (fmax z3 z2)) z1)))
            (if (<= z1 -1.2e+168)
              (/
               z0
               (+ 2.0 (/ (* (+ (fmin z3 z2) (fmin z3 z2)) (fmax z3 z2)) z1)))
              (if (<= z1 2.5e-135)
                (/ z0 (+ 2.0 (/ (+ t_0 t_0) (* z1 z1))))
                (if (<= z1 8.2e-78)
                  (/
                   (* -0.5 (* z0 (* z1 (* (fmax z3 z2) (fmin z3 z2)))))
                   (* z1 z1))
                  (/
                   z0
                   (+
                    2.0
                    (* (/ (fmin z3 z2) z1) (+ (fmax z3 z2) (fmax z3 z2))))))))))
          double code(double z0, double z1, double z3, double z2) {
          	double t_0 = (fmin(z3, z2) * fmax(z3, z2)) * z1;
          	double tmp;
          	if (z1 <= -1.2e+168) {
          		tmp = z0 / (2.0 + (((fmin(z3, z2) + fmin(z3, z2)) * fmax(z3, z2)) / z1));
          	} else if (z1 <= 2.5e-135) {
          		tmp = z0 / (2.0 + ((t_0 + t_0) / (z1 * z1)));
          	} else if (z1 <= 8.2e-78) {
          		tmp = (-0.5 * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1);
          	} else {
          		tmp = z0 / (2.0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))));
          	}
          	return tmp;
          }
          
          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(z0, z1, z3, z2)
          use fmin_fmax_functions
              real(8), intent (in) :: z0
              real(8), intent (in) :: z1
              real(8), intent (in) :: z3
              real(8), intent (in) :: z2
              real(8) :: t_0
              real(8) :: tmp
              t_0 = (fmin(z3, z2) * fmax(z3, z2)) * z1
              if (z1 <= (-1.2d+168)) then
                  tmp = z0 / (2.0d0 + (((fmin(z3, z2) + fmin(z3, z2)) * fmax(z3, z2)) / z1))
              else if (z1 <= 2.5d-135) then
                  tmp = z0 / (2.0d0 + ((t_0 + t_0) / (z1 * z1)))
              else if (z1 <= 8.2d-78) then
                  tmp = ((-0.5d0) * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1)
              else
                  tmp = z0 / (2.0d0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))))
              end if
              code = tmp
          end function
          
          public static double code(double z0, double z1, double z3, double z2) {
          	double t_0 = (fmin(z3, z2) * fmax(z3, z2)) * z1;
          	double tmp;
          	if (z1 <= -1.2e+168) {
          		tmp = z0 / (2.0 + (((fmin(z3, z2) + fmin(z3, z2)) * fmax(z3, z2)) / z1));
          	} else if (z1 <= 2.5e-135) {
          		tmp = z0 / (2.0 + ((t_0 + t_0) / (z1 * z1)));
          	} else if (z1 <= 8.2e-78) {
          		tmp = (-0.5 * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1);
          	} else {
          		tmp = z0 / (2.0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))));
          	}
          	return tmp;
          }
          
          def code(z0, z1, z3, z2):
          	t_0 = (fmin(z3, z2) * fmax(z3, z2)) * z1
          	tmp = 0
          	if z1 <= -1.2e+168:
          		tmp = z0 / (2.0 + (((fmin(z3, z2) + fmin(z3, z2)) * fmax(z3, z2)) / z1))
          	elif z1 <= 2.5e-135:
          		tmp = z0 / (2.0 + ((t_0 + t_0) / (z1 * z1)))
          	elif z1 <= 8.2e-78:
          		tmp = (-0.5 * (z0 * (z1 * (fmax(z3, z2) * fmin(z3, z2))))) / (z1 * z1)
          	else:
          		tmp = z0 / (2.0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))))
          	return tmp
          
          function code(z0, z1, z3, z2)
          	t_0 = Float64(Float64(fmin(z3, z2) * fmax(z3, z2)) * z1)
          	tmp = 0.0
          	if (z1 <= -1.2e+168)
          		tmp = Float64(z0 / Float64(2.0 + Float64(Float64(Float64(fmin(z3, z2) + fmin(z3, z2)) * fmax(z3, z2)) / z1)));
          	elseif (z1 <= 2.5e-135)
          		tmp = Float64(z0 / Float64(2.0 + Float64(Float64(t_0 + t_0) / Float64(z1 * z1))));
          	elseif (z1 <= 8.2e-78)
          		tmp = Float64(Float64(-0.5 * Float64(z0 * Float64(z1 * Float64(fmax(z3, z2) * fmin(z3, z2))))) / Float64(z1 * z1));
          	else
          		tmp = Float64(z0 / Float64(2.0 + Float64(Float64(fmin(z3, z2) / z1) * Float64(fmax(z3, z2) + fmax(z3, z2)))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(z0, z1, z3, z2)
          	t_0 = (min(z3, z2) * max(z3, z2)) * z1;
          	tmp = 0.0;
          	if (z1 <= -1.2e+168)
          		tmp = z0 / (2.0 + (((min(z3, z2) + min(z3, z2)) * max(z3, z2)) / z1));
          	elseif (z1 <= 2.5e-135)
          		tmp = z0 / (2.0 + ((t_0 + t_0) / (z1 * z1)));
          	elseif (z1 <= 8.2e-78)
          		tmp = (-0.5 * (z0 * (z1 * (max(z3, z2) * min(z3, z2))))) / (z1 * z1);
          	else
          		tmp = z0 / (2.0 + ((min(z3, z2) / z1) * (max(z3, z2) + max(z3, z2))));
          	end
          	tmp_2 = tmp;
          end
          
          code[z0_, z1_, z3_, z2_] := Block[{t$95$0 = N[(N[(N[Min[z3, z2], $MachinePrecision] * N[Max[z3, z2], $MachinePrecision]), $MachinePrecision] * z1), $MachinePrecision]}, If[LessEqual[z1, -1.2e+168], N[(z0 / N[(2.0 + N[(N[(N[(N[Min[z3, z2], $MachinePrecision] + N[Min[z3, z2], $MachinePrecision]), $MachinePrecision] * N[Max[z3, z2], $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z1, 2.5e-135], N[(z0 / N[(2.0 + N[(N[(t$95$0 + t$95$0), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z1, 8.2e-78], N[(N[(-0.5 * N[(z0 * N[(z1 * N[(N[Max[z3, z2], $MachinePrecision] * N[Min[z3, z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z1 * z1), $MachinePrecision]), $MachinePrecision], N[(z0 / N[(2.0 + N[(N[(N[Min[z3, z2], $MachinePrecision] / z1), $MachinePrecision] * N[(N[Max[z3, z2], $MachinePrecision] + N[Max[z3, z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          t_0 := \left(\mathsf{min}\left(z3, z2\right) \cdot \mathsf{max}\left(z3, z2\right)\right) \cdot z1\\
          \mathbf{if}\;z1 \leq -1.2 \cdot 10^{+168}:\\
          \;\;\;\;\frac{z0}{2 + \frac{\left(\mathsf{min}\left(z3, z2\right) + \mathsf{min}\left(z3, z2\right)\right) \cdot \mathsf{max}\left(z3, z2\right)}{z1}}\\
          
          \mathbf{elif}\;z1 \leq 2.5 \cdot 10^{-135}:\\
          \;\;\;\;\frac{z0}{2 + \frac{t\_0 + t\_0}{z1 \cdot z1}}\\
          
          \mathbf{elif}\;z1 \leq 8.2 \cdot 10^{-78}:\\
          \;\;\;\;\frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(\mathsf{max}\left(z3, z2\right) \cdot \mathsf{min}\left(z3, z2\right)\right)\right)\right)}{z1 \cdot z1}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{z0}{2 + \frac{\mathsf{min}\left(z3, z2\right)}{z1} \cdot \left(\mathsf{max}\left(z3, z2\right) + \mathsf{max}\left(z3, z2\right)\right)}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if z1 < -1.2e168

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              4. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}} \]
            4. Applied rewrites66.6%

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              2. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              3. associate-*r/N/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z2 \cdot z3\right)}{\color{blue}{z1}}} \]
              4. div-flipN/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z2 \cdot z3\right)}}}} \]
              5. lower-unsound-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z2 \cdot z3\right)}}}} \]
              6. lower-unsound-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{\color{blue}{2 \cdot \left(z2 \cdot z3\right)}}}} \]
              7. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \color{blue}{\left(z2 \cdot z3\right)}}}} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \left(z2 \cdot \color{blue}{z3}\right)}}} \]
              9. *-commutativeN/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \left(z3 \cdot \color{blue}{z2}\right)}}} \]
              10. lift-*.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{2 \cdot \left(z3 \cdot \color{blue}{z2}\right)}}} \]
            6. Applied rewrites66.6%

              \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z3 \cdot z2\right)}}}} \]
            7. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\color{blue}{\frac{z1}{2 \cdot \left(z3 \cdot z2\right)}}}} \]
              2. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{1}{\frac{z1}{\color{blue}{2 \cdot \left(z3 \cdot z2\right)}}}} \]
              3. div-flip-revN/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{\color{blue}{z1}}} \]
              4. lower-/.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{\color{blue}{z1}}} \]
              5. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{z1}} \]
              6. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{2 \cdot \left(z3 \cdot z2\right)}{z1}} \]
              7. associate-*r*N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(2 \cdot z3\right) \cdot z2}{z1}} \]
              8. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(2 \cdot z3\right) \cdot z2}{z1}} \]
              9. count-2-revN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 + z3\right) \cdot z2}{z1}} \]
              10. lower-+.f6466.6%

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 + z3\right) \cdot z2}{z1}} \]
            8. Applied rewrites66.6%

              \[\leadsto \frac{z0}{2 + \frac{\left(z3 + z3\right) \cdot z2}{\color{blue}{z1}}} \]

            if -1.2e168 < z1 < 2.5000000000000001e-135

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              4. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}} \]
            4. Applied rewrites66.6%

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              2. count-2-revN/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \color{blue}{\frac{z2 \cdot z3}{z1}}\right)} \]
              3. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{\color{blue}{z2 \cdot z3}}{z1}\right)} \]
              4. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{z2 \cdot z3}{\color{blue}{z1}}\right)} \]
              5. common-denominatorN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{\color{blue}{z1 \cdot z1}}} \]
              6. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{\color{blue}{z1 \cdot z1}}} \]
              7. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{\color{blue}{z1} \cdot z1}} \]
              8. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              9. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z2 \cdot z3\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              10. *-commutativeN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              11. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              12. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              13. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z2 \cdot z3\right) \cdot z1}{z1 \cdot z1}} \]
              14. *-commutativeN/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{z1 \cdot z1}} \]
              15. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{z1 \cdot z1}} \]
              16. lower-*.f6460.4%

                \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{z1 \cdot \color{blue}{z1}}} \]
            6. Applied rewrites60.4%

              \[\leadsto \frac{z0}{2 + \frac{\left(z3 \cdot z2\right) \cdot z1 + \left(z3 \cdot z2\right) \cdot z1}{\color{blue}{z1 \cdot z1}}} \]

            if 2.5000000000000001e-135 < z1 < 8.1999999999999996e-78

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2}} \cdot z0 \]
              3. lower-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              4. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              5. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              6. lower-*.f6447.1%

                \[\leadsto -0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot \color{blue}{z0} \]
            4. Applied rewrites47.1%

              \[\leadsto \color{blue}{-0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot z0} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot \color{blue}{z0} \]
              3. fp-cancel-sign-sub-invN/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot z0} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot z0 \]
              5. metadata-evalN/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \frac{-1}{2} \cdot z0 \]
              6. distribute-lft-out--N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right)} \]
              8. lower--.f6447.1%

                \[\leadsto -0.5 \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{z0}\right) \]
              9. lift-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right) \]
              10. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right) \]
              11. associate-/l*N/A

                \[\leadsto \frac{-1}{2} \cdot \left(z0 \cdot \frac{z2 \cdot z3}{z1} - z0\right) \]
              12. lift-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(z0 \cdot \frac{z2 \cdot z3}{z1} - z0\right) \]
              13. *-commutativeN/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              14. lower-*.f6449.1%

                \[\leadsto -0.5 \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              15. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              16. *-commutativeN/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
              17. lift-*.f6449.1%

                \[\leadsto -0.5 \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
            6. Applied rewrites49.1%

              \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right)} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right)} \]
              2. lift--.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - \color{blue}{z0}\right) \]
              3. distribute-rgt-out--N/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} - \color{blue}{z0 \cdot \frac{-1}{2}} \]
              4. lift-*.f64N/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} - \color{blue}{z0} \cdot \frac{-1}{2} \]
              5. *-commutativeN/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} - \frac{-1}{2} \cdot \color{blue}{z0} \]
              6. fp-cancel-sub-sign-invN/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right) \cdot z0} \]
              7. metadata-evalN/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} + \frac{1}{2} \cdot z0 \]
              8. lift-*.f64N/A

                \[\leadsto \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} + \frac{1}{2} \cdot \color{blue}{z0} \]
              9. +-commutativeN/A

                \[\leadsto \frac{1}{2} \cdot z0 + \color{blue}{\left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2}} \]
              10. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \color{blue}{\frac{-1}{2}} \]
              11. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} \]
              12. lift-/.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \left(\frac{z3 \cdot z2}{z1} \cdot z0\right) \cdot \frac{-1}{2} \]
              13. associate-*l/N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(z3 \cdot z2\right) \cdot z0}{z1} \cdot \frac{-1}{2} \]
              14. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(z3 \cdot z2\right) \cdot z0}{z1} \cdot \frac{-1}{2} \]
              15. associate-*l/N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{\color{blue}{z1}} \]
              16. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              17. add-to-fraction-revN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{\color{blue}{z1}} \]
              18. lift-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
            8. Applied rewrites20.7%

              \[\leadsto \frac{\left(\left(0.5 \cdot z0\right) \cdot z1\right) \cdot z1 - z1 \cdot \left(\left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot 0.5\right)}{\color{blue}{z1 \cdot z1}} \]
            9. Taylor expanded in z1 around 0

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{\color{blue}{z1} \cdot z1} \]
            10. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
              3. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
              4. lower-*.f6411.0%

                \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{z1 \cdot z1} \]
            11. Applied rewrites11.0%

              \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z1 \cdot \left(z2 \cdot z3\right)\right)\right)}{\color{blue}{z1} \cdot z1} \]

            if 8.1999999999999996e-78 < z1

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
              4. lower-*.f6466.6%

                \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}} \]
            4. Applied rewrites66.6%

              \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
              2. count-2-revN/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \color{blue}{\frac{z2 \cdot z3}{z1}}\right)} \]
              3. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{\color{blue}{z2 \cdot z3}}{z1}\right)} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{\color{blue}{z2} \cdot z3}{z1}\right)} \]
              5. associate-/l*N/A

                \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + \frac{\color{blue}{z2 \cdot z3}}{z1}\right)} \]
              6. lift-/.f64N/A

                \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + \frac{z2 \cdot z3}{\color{blue}{z1}}\right)} \]
              7. lift-*.f64N/A

                \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + \frac{z2 \cdot z3}{z1}\right)} \]
              8. associate-/l*N/A

                \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + z2 \cdot \color{blue}{\frac{z3}{z1}}\right)} \]
              9. distribute-rgt-outN/A

                \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \color{blue}{\left(z2 + z2\right)}} \]
              10. lower-*.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \color{blue}{\left(z2 + z2\right)}} \]
              11. lower-/.f64N/A

                \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \left(\color{blue}{z2} + z2\right)} \]
              12. lower-+.f6466.7%

                \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \left(z2 + \color{blue}{z2}\right)} \]
            6. Applied rewrites66.7%

              \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \color{blue}{\left(z2 + z2\right)}} \]
          3. Recombined 4 regimes into one program.
          4. Add Preprocessing

          Alternative 6: 66.9% accurate, 0.7× speedup?

          \[\frac{z0}{2 + \frac{\mathsf{min}\left(z3, z2\right)}{z1} \cdot \left(\mathsf{max}\left(z3, z2\right) + \mathsf{max}\left(z3, z2\right)\right)} \]
          (FPCore (z0 z1 z3 z2)
            :precision binary64
            (/ z0 (+ 2.0 (* (/ (fmin z3 z2) z1) (+ (fmax z3 z2) (fmax z3 z2))))))
          double code(double z0, double z1, double z3, double z2) {
          	return z0 / (2.0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))));
          }
          
          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(z0, z1, z3, z2)
          use fmin_fmax_functions
              real(8), intent (in) :: z0
              real(8), intent (in) :: z1
              real(8), intent (in) :: z3
              real(8), intent (in) :: z2
              code = z0 / (2.0d0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))))
          end function
          
          public static double code(double z0, double z1, double z3, double z2) {
          	return z0 / (2.0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))));
          }
          
          def code(z0, z1, z3, z2):
          	return z0 / (2.0 + ((fmin(z3, z2) / z1) * (fmax(z3, z2) + fmax(z3, z2))))
          
          function code(z0, z1, z3, z2)
          	return Float64(z0 / Float64(2.0 + Float64(Float64(fmin(z3, z2) / z1) * Float64(fmax(z3, z2) + fmax(z3, z2)))))
          end
          
          function tmp = code(z0, z1, z3, z2)
          	tmp = z0 / (2.0 + ((min(z3, z2) / z1) * (max(z3, z2) + max(z3, z2))));
          end
          
          code[z0_, z1_, z3_, z2_] := N[(z0 / N[(2.0 + N[(N[(N[Min[z3, z2], $MachinePrecision] / z1), $MachinePrecision] * N[(N[Max[z3, z2], $MachinePrecision] + N[Max[z3, z2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \frac{z0}{2 + \frac{\mathsf{min}\left(z3, z2\right)}{z1} \cdot \left(\mathsf{max}\left(z3, z2\right) + \mathsf{max}\left(z3, z2\right)\right)}
          
          Derivation
          1. Initial program 99.5%

            \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
          2. Taylor expanded in z1 around inf

            \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
          3. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \frac{z0}{2 + \color{blue}{2 \cdot \frac{z2 \cdot z3}{z1}}} \]
            2. lower-*.f64N/A

              \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
            3. lower-/.f64N/A

              \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{\color{blue}{z1}}} \]
            4. lower-*.f6466.6%

              \[\leadsto \frac{z0}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}} \]
          4. Applied rewrites66.6%

            \[\leadsto \frac{z0}{\color{blue}{2 + 2 \cdot \frac{z2 \cdot z3}{z1}}} \]
          5. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{z0}{2 + 2 \cdot \color{blue}{\frac{z2 \cdot z3}{z1}}} \]
            2. count-2-revN/A

              \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \color{blue}{\frac{z2 \cdot z3}{z1}}\right)} \]
            3. lift-/.f64N/A

              \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{\color{blue}{z2 \cdot z3}}{z1}\right)} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{z0}{2 + \left(\frac{z2 \cdot z3}{z1} + \frac{\color{blue}{z2} \cdot z3}{z1}\right)} \]
            5. associate-/l*N/A

              \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + \frac{\color{blue}{z2 \cdot z3}}{z1}\right)} \]
            6. lift-/.f64N/A

              \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + \frac{z2 \cdot z3}{\color{blue}{z1}}\right)} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + \frac{z2 \cdot z3}{z1}\right)} \]
            8. associate-/l*N/A

              \[\leadsto \frac{z0}{2 + \left(z2 \cdot \frac{z3}{z1} + z2 \cdot \color{blue}{\frac{z3}{z1}}\right)} \]
            9. distribute-rgt-outN/A

              \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \color{blue}{\left(z2 + z2\right)}} \]
            10. lower-*.f64N/A

              \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \color{blue}{\left(z2 + z2\right)}} \]
            11. lower-/.f64N/A

              \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \left(\color{blue}{z2} + z2\right)} \]
            12. lower-+.f6466.7%

              \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \left(z2 + \color{blue}{z2}\right)} \]
          6. Applied rewrites66.7%

            \[\leadsto \frac{z0}{2 + \frac{z3}{z1} \cdot \color{blue}{\left(z2 + z2\right)}} \]
          7. Add Preprocessing

          Alternative 7: 59.5% accurate, 0.9× speedup?

          \[\begin{array}{l} \mathbf{if}\;\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}} \leq 4:\\ \;\;\;\;-0.5 \cdot \left(\left(\frac{z2}{z1} \cdot z3\right) \cdot z0 - z0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1}\\ \end{array} \]
          (FPCore (z0 z1 z3 z2)
            :precision binary64
            (if (<=
               (* (* (sinh (/ 1.0 z1)) (+ z1 z1)) (exp (/ (* z3 z2) z1)))
               4.0)
            (* -0.5 (- (* (* (/ z2 z1) z3) z0) z0))
            (/ (* -0.5 (* z0 (* z2 z3))) z1)))
          double code(double z0, double z1, double z3, double z2) {
          	double tmp;
          	if (((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1))) <= 4.0) {
          		tmp = -0.5 * ((((z2 / z1) * z3) * z0) - z0);
          	} else {
          		tmp = (-0.5 * (z0 * (z2 * z3))) / z1;
          	}
          	return tmp;
          }
          
          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(z0, z1, z3, z2)
          use fmin_fmax_functions
              real(8), intent (in) :: z0
              real(8), intent (in) :: z1
              real(8), intent (in) :: z3
              real(8), intent (in) :: z2
              real(8) :: tmp
              if (((sinh((1.0d0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1))) <= 4.0d0) then
                  tmp = (-0.5d0) * ((((z2 / z1) * z3) * z0) - z0)
              else
                  tmp = ((-0.5d0) * (z0 * (z2 * z3))) / z1
              end if
              code = tmp
          end function
          
          public static double code(double z0, double z1, double z3, double z2) {
          	double tmp;
          	if (((Math.sinh((1.0 / z1)) * (z1 + z1)) * Math.exp(((z3 * z2) / z1))) <= 4.0) {
          		tmp = -0.5 * ((((z2 / z1) * z3) * z0) - z0);
          	} else {
          		tmp = (-0.5 * (z0 * (z2 * z3))) / z1;
          	}
          	return tmp;
          }
          
          def code(z0, z1, z3, z2):
          	tmp = 0
          	if ((math.sinh((1.0 / z1)) * (z1 + z1)) * math.exp(((z3 * z2) / z1))) <= 4.0:
          		tmp = -0.5 * ((((z2 / z1) * z3) * z0) - z0)
          	else:
          		tmp = (-0.5 * (z0 * (z2 * z3))) / z1
          	return tmp
          
          function code(z0, z1, z3, z2)
          	tmp = 0.0
          	if (Float64(Float64(sinh(Float64(1.0 / z1)) * Float64(z1 + z1)) * exp(Float64(Float64(z3 * z2) / z1))) <= 4.0)
          		tmp = Float64(-0.5 * Float64(Float64(Float64(Float64(z2 / z1) * z3) * z0) - z0));
          	else
          		tmp = Float64(Float64(-0.5 * Float64(z0 * Float64(z2 * z3))) / z1);
          	end
          	return tmp
          end
          
          function tmp_2 = code(z0, z1, z3, z2)
          	tmp = 0.0;
          	if (((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1))) <= 4.0)
          		tmp = -0.5 * ((((z2 / z1) * z3) * z0) - z0);
          	else
          		tmp = (-0.5 * (z0 * (z2 * z3))) / z1;
          	end
          	tmp_2 = tmp;
          end
          
          code[z0_, z1_, z3_, z2_] := If[LessEqual[N[(N[(N[Sinh[N[(1.0 / z1), $MachinePrecision]], $MachinePrecision] * N[(z1 + z1), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(z3 * z2), $MachinePrecision] / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 4.0], N[(-0.5 * N[(N[(N[(N[(z2 / z1), $MachinePrecision] * z3), $MachinePrecision] * z0), $MachinePrecision] - z0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[(z0 * N[(z2 * z3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision]]
          
          \begin{array}{l}
          \mathbf{if}\;\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}} \leq 4:\\
          \;\;\;\;-0.5 \cdot \left(\left(\frac{z2}{z1} \cdot z3\right) \cdot z0 - z0\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{-0.5 \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (*.f64 (sinh.f64 (/.f64 #s(literal 1 binary64) z1)) (+.f64 z1 z1)) (exp.f64 (/.f64 (*.f64 z3 z2) z1))) < 4

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2}} \cdot z0 \]
              3. lower-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              4. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              5. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              6. lower-*.f6447.1%

                \[\leadsto -0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot \color{blue}{z0} \]
            4. Applied rewrites47.1%

              \[\leadsto \color{blue}{-0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot z0} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot \color{blue}{z0} \]
              3. fp-cancel-sign-sub-invN/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot z0} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot z0 \]
              5. metadata-evalN/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \frac{-1}{2} \cdot z0 \]
              6. distribute-lft-out--N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right)} \]
              8. lower--.f6447.1%

                \[\leadsto -0.5 \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - \color{blue}{z0}\right) \]
              9. lift-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right) \]
              10. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} - z0\right) \]
              11. associate-/l*N/A

                \[\leadsto \frac{-1}{2} \cdot \left(z0 \cdot \frac{z2 \cdot z3}{z1} - z0\right) \]
              12. lift-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(z0 \cdot \frac{z2 \cdot z3}{z1} - z0\right) \]
              13. *-commutativeN/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              14. lower-*.f6449.1%

                \[\leadsto -0.5 \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              15. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z2 \cdot z3}{z1} \cdot z0 - z0\right) \]
              16. *-commutativeN/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
              17. lift-*.f6449.1%

                \[\leadsto -0.5 \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
            6. Applied rewrites49.1%

              \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right)} \]
            7. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
              2. lift-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\frac{z3 \cdot z2}{z1} \cdot z0 - z0\right) \]
              3. associate-/l*N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\left(z3 \cdot \frac{z2}{z1}\right) \cdot z0 - z0\right) \]
              4. *-commutativeN/A

                \[\leadsto \frac{-1}{2} \cdot \left(\left(\frac{z2}{z1} \cdot z3\right) \cdot z0 - z0\right) \]
              5. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \left(\left(\frac{z2}{z1} \cdot z3\right) \cdot z0 - z0\right) \]
              6. lower-/.f6449.1%

                \[\leadsto -0.5 \cdot \left(\left(\frac{z2}{z1} \cdot z3\right) \cdot z0 - z0\right) \]
            8. Applied rewrites49.1%

              \[\leadsto -0.5 \cdot \left(\left(\frac{z2}{z1} \cdot z3\right) \cdot z0 - z0\right) \]

            if 4 < (*.f64 (*.f64 (sinh.f64 (/.f64 #s(literal 1 binary64) z1)) (+.f64 z1 z1)) (exp.f64 (/.f64 (*.f64 z3 z2) z1)))

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2}} \cdot z0 \]
              3. lower-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              4. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              5. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              6. lower-*.f6447.1%

                \[\leadsto -0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot \color{blue}{z0} \]
            4. Applied rewrites47.1%

              \[\leadsto \color{blue}{-0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot z0} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. +-commutativeN/A

                \[\leadsto \frac{1}{2} \cdot z0 + \color{blue}{\frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1}} \]
              3. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{-1}{2} \cdot \color{blue}{\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1}} \]
              4. lift-/.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{\color{blue}{z1}} \]
              5. associate-*r/N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{\color{blue}{z1}} \]
              6. add-to-fractionN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{\color{blue}{z1}} \]
              7. lower-/.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{\color{blue}{z1}} \]
              8. lower-+.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              9. lower-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              10. *-commutativeN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(z0 \cdot \left(z2 \cdot z3\right)\right) \cdot \frac{-1}{2}}{z1} \]
              11. lower-*.f6440.4%

                \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(z0 \cdot \left(z2 \cdot z3\right)\right) \cdot -0.5}{z1} \]
              12. lift-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(z0 \cdot \left(z2 \cdot z3\right)\right) \cdot \frac{-1}{2}}{z1} \]
              13. *-commutativeN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              14. lower-*.f6440.4%

                \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot -0.5}{z1} \]
              15. lift-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              16. *-commutativeN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              17. lift-*.f6440.4%

                \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot -0.5}{z1} \]
            6. Applied rewrites40.4%

              \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot -0.5}{\color{blue}{z1}} \]
            7. Taylor expanded in z0 around 0

              \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
            8. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              2. lower-+.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              3. lower-*.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              5. lower-*.f6440.5%

                \[\leadsto \frac{z0 \cdot \left(-0.5 \cdot \left(z2 \cdot z3\right) + 0.5 \cdot z1\right)}{z1} \]
            9. Applied rewrites40.5%

              \[\leadsto \frac{z0 \cdot \left(-0.5 \cdot \left(z2 \cdot z3\right) + 0.5 \cdot z1\right)}{z1} \]
            10. Taylor expanded in z1 around 0

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
            11. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              3. lower-*.f6414.1%

                \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
            12. Applied rewrites14.1%

              \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 8: 59.2% accurate, 0.6× speedup?

          \[\mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l} \mathbf{if}\;\frac{\left|z0\right|}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \leq 0:\\ \;\;\;\;\frac{-0.5 \cdot \left(\left|z0\right| \cdot \left(z2 \cdot z3\right)\right)}{z1}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left|z0\right|\\ \end{array} \]
          (FPCore (z0 z1 z3 z2)
            :precision binary64
            (*
           (copysign 1.0 z0)
           (if (<=
                (/
                 (fabs z0)
                 (* (* (sinh (/ 1.0 z1)) (+ z1 z1)) (exp (/ (* z3 z2) z1))))
                0.0)
             (/ (* -0.5 (* (fabs z0) (* z2 z3))) z1)
             (* 0.5 (fabs z0)))))
          double code(double z0, double z1, double z3, double z2) {
          	double tmp;
          	if ((fabs(z0) / ((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)))) <= 0.0) {
          		tmp = (-0.5 * (fabs(z0) * (z2 * z3))) / z1;
          	} else {
          		tmp = 0.5 * fabs(z0);
          	}
          	return copysign(1.0, z0) * tmp;
          }
          
          public static double code(double z0, double z1, double z3, double z2) {
          	double tmp;
          	if ((Math.abs(z0) / ((Math.sinh((1.0 / z1)) * (z1 + z1)) * Math.exp(((z3 * z2) / z1)))) <= 0.0) {
          		tmp = (-0.5 * (Math.abs(z0) * (z2 * z3))) / z1;
          	} else {
          		tmp = 0.5 * Math.abs(z0);
          	}
          	return Math.copySign(1.0, z0) * tmp;
          }
          
          def code(z0, z1, z3, z2):
          	tmp = 0
          	if (math.fabs(z0) / ((math.sinh((1.0 / z1)) * (z1 + z1)) * math.exp(((z3 * z2) / z1)))) <= 0.0:
          		tmp = (-0.5 * (math.fabs(z0) * (z2 * z3))) / z1
          	else:
          		tmp = 0.5 * math.fabs(z0)
          	return math.copysign(1.0, z0) * tmp
          
          function code(z0, z1, z3, z2)
          	tmp = 0.0
          	if (Float64(abs(z0) / Float64(Float64(sinh(Float64(1.0 / z1)) * Float64(z1 + z1)) * exp(Float64(Float64(z3 * z2) / z1)))) <= 0.0)
          		tmp = Float64(Float64(-0.5 * Float64(abs(z0) * Float64(z2 * z3))) / z1);
          	else
          		tmp = Float64(0.5 * abs(z0));
          	end
          	return Float64(copysign(1.0, z0) * tmp)
          end
          
          function tmp_2 = code(z0, z1, z3, z2)
          	tmp = 0.0;
          	if ((abs(z0) / ((sinh((1.0 / z1)) * (z1 + z1)) * exp(((z3 * z2) / z1)))) <= 0.0)
          		tmp = (-0.5 * (abs(z0) * (z2 * z3))) / z1;
          	else
          		tmp = 0.5 * abs(z0);
          	end
          	tmp_2 = (sign(z0) * abs(1.0)) * tmp;
          end
          
          code[z0_, z1_, z3_, z2_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[Abs[z0], $MachinePrecision] / N[(N[(N[Sinh[N[(1.0 / z1), $MachinePrecision]], $MachinePrecision] * N[(z1 + z1), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(z3 * z2), $MachinePrecision] / z1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(-0.5 * N[(N[Abs[z0], $MachinePrecision] * N[(z2 * z3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z1), $MachinePrecision], N[(0.5 * N[Abs[z0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
          
          \mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l}
          \mathbf{if}\;\frac{\left|z0\right|}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \leq 0:\\
          \;\;\;\;\frac{-0.5 \cdot \left(\left|z0\right| \cdot \left(z2 \cdot z3\right)\right)}{z1}\\
          
          \mathbf{else}:\\
          \;\;\;\;0.5 \cdot \left|z0\right|\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 z0 (*.f64 (*.f64 (sinh.f64 (/.f64 #s(literal 1 binary64) z1)) (+.f64 z1 z1)) (exp.f64 (/.f64 (*.f64 z3 z2) z1)))) < 0.0

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2}} \cdot z0 \]
              3. lower-/.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              4. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              5. lower-*.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \frac{1}{2} \cdot z0 \]
              6. lower-*.f6447.1%

                \[\leadsto -0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot \color{blue}{z0} \]
            4. Applied rewrites47.1%

              \[\leadsto \color{blue}{-0.5 \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + 0.5 \cdot z0} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1} + \color{blue}{\frac{1}{2} \cdot z0} \]
              2. +-commutativeN/A

                \[\leadsto \frac{1}{2} \cdot z0 + \color{blue}{\frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{z1}} \]
              3. lift-*.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{-1}{2} \cdot \color{blue}{\frac{z0 \cdot \left(z2 \cdot z3\right)}{z1}} \]
              4. lift-/.f64N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{-1}{2} \cdot \frac{z0 \cdot \left(z2 \cdot z3\right)}{\color{blue}{z1}} \]
              5. associate-*r/N/A

                \[\leadsto \frac{1}{2} \cdot z0 + \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{\color{blue}{z1}} \]
              6. add-to-fractionN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{\color{blue}{z1}} \]
              7. lower-/.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{\color{blue}{z1}} \]
              8. lower-+.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              9. lower-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              10. *-commutativeN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(z0 \cdot \left(z2 \cdot z3\right)\right) \cdot \frac{-1}{2}}{z1} \]
              11. lower-*.f6440.4%

                \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(z0 \cdot \left(z2 \cdot z3\right)\right) \cdot -0.5}{z1} \]
              12. lift-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(z0 \cdot \left(z2 \cdot z3\right)\right) \cdot \frac{-1}{2}}{z1} \]
              13. *-commutativeN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              14. lower-*.f6440.4%

                \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot -0.5}{z1} \]
              15. lift-*.f64N/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z2 \cdot z3\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              16. *-commutativeN/A

                \[\leadsto \frac{\left(\frac{1}{2} \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot \frac{-1}{2}}{z1} \]
              17. lift-*.f6440.4%

                \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot -0.5}{z1} \]
            6. Applied rewrites40.4%

              \[\leadsto \frac{\left(0.5 \cdot z0\right) \cdot z1 + \left(\left(z3 \cdot z2\right) \cdot z0\right) \cdot -0.5}{\color{blue}{z1}} \]
            7. Taylor expanded in z0 around 0

              \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
            8. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              2. lower-+.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              3. lower-*.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{z0 \cdot \left(\frac{-1}{2} \cdot \left(z2 \cdot z3\right) + \frac{1}{2} \cdot z1\right)}{z1} \]
              5. lower-*.f6440.5%

                \[\leadsto \frac{z0 \cdot \left(-0.5 \cdot \left(z2 \cdot z3\right) + 0.5 \cdot z1\right)}{z1} \]
            9. Applied rewrites40.5%

              \[\leadsto \frac{z0 \cdot \left(-0.5 \cdot \left(z2 \cdot z3\right) + 0.5 \cdot z1\right)}{z1} \]
            10. Taylor expanded in z1 around 0

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
            11. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{\frac{-1}{2} \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
              3. lower-*.f6414.1%

                \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]
            12. Applied rewrites14.1%

              \[\leadsto \frac{-0.5 \cdot \left(z0 \cdot \left(z2 \cdot z3\right)\right)}{z1} \]

            if 0.0 < (/.f64 z0 (*.f64 (*.f64 (sinh.f64 (/.f64 #s(literal 1 binary64) z1)) (+.f64 z1 z1)) (exp.f64 (/.f64 (*.f64 z3 z2) z1))))

            1. Initial program 99.5%

              \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
            2. Taylor expanded in z1 around inf

              \[\leadsto \color{blue}{\frac{1}{2} \cdot z0} \]
            3. Step-by-step derivation
              1. lower-*.f6449.3%

                \[\leadsto 0.5 \cdot \color{blue}{z0} \]
            4. Applied rewrites49.3%

              \[\leadsto \color{blue}{0.5 \cdot z0} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 9: 49.3% accurate, 42.0× speedup?

          \[0.5 \cdot z0 \]
          (FPCore (z0 z1 z3 z2)
            :precision binary64
            (* 0.5 z0))
          double code(double z0, double z1, double z3, double z2) {
          	return 0.5 * z0;
          }
          
          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(z0, z1, z3, z2)
          use fmin_fmax_functions
              real(8), intent (in) :: z0
              real(8), intent (in) :: z1
              real(8), intent (in) :: z3
              real(8), intent (in) :: z2
              code = 0.5d0 * z0
          end function
          
          public static double code(double z0, double z1, double z3, double z2) {
          	return 0.5 * z0;
          }
          
          def code(z0, z1, z3, z2):
          	return 0.5 * z0
          
          function code(z0, z1, z3, z2)
          	return Float64(0.5 * z0)
          end
          
          function tmp = code(z0, z1, z3, z2)
          	tmp = 0.5 * z0;
          end
          
          code[z0_, z1_, z3_, z2_] := N[(0.5 * z0), $MachinePrecision]
          
          0.5 \cdot z0
          
          Derivation
          1. Initial program 99.5%

            \[\frac{z0}{\left(\sinh \left(\frac{1}{z1}\right) \cdot \left(z1 + z1\right)\right) \cdot e^{\frac{z3 \cdot z2}{z1}}} \]
          2. Taylor expanded in z1 around inf

            \[\leadsto \color{blue}{\frac{1}{2} \cdot z0} \]
          3. Step-by-step derivation
            1. lower-*.f6449.3%

              \[\leadsto 0.5 \cdot \color{blue}{z0} \]
          4. Applied rewrites49.3%

            \[\leadsto \color{blue}{0.5 \cdot z0} \]
          5. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2025250 
          (FPCore (z0 z1 z3 z2)
            :name "(/ z0 (* (* (sinh (/ 1 z1)) (+ z1 z1)) (exp (/ (* z3 z2) z1))))"
            :precision binary64
            (/ z0 (* (* (sinh (/ 1.0 z1)) (+ z1 z1)) (exp (/ (* z3 z2) z1)))))