Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1

Percentage Accurate: 96.8% → 99.7%
Time: 1.5min
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\frac{x - y}{z - y} \cdot t \]
(FPCore (x y z t)
  :precision binary64
  (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t):
	return ((x - y) / (z - y)) * t
function code(x, y, z, t)
	return Float64(Float64(Float64(x - y) / Float64(z - y)) * t)
end
function tmp = code(x, y, z, t)
	tmp = ((x - y) / (z - y)) * t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\frac{x - y}{z - y} \cdot t

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

\[\frac{x - y}{z - y} \cdot t \]
(FPCore (x y z t)
  :precision binary64
  (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
	return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t):
	return ((x - y) / (z - y)) * t
function code(x, y, z, t)
	return Float64(Float64(Float64(x - y) / Float64(z - y)) * t)
end
function tmp = code(x, y, z, t)
	tmp = ((x - y) / (z - y)) * t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\frac{x - y}{z - y} \cdot t

Alternative 1: 99.7% accurate, 0.7× speedup?

\[\mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{z - y}\right), y, t, x, t\right) \]
(FPCore (x y z t)
  :precision binary64
  (134-z0z1z2z3z4 (/ -1 (- z y)) y t x t))
\mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{z - y}\right), y, t, x, t\right)
Derivation
  1. Initial program 96.8%

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

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

      \[\leadsto \color{blue}{\frac{x - y}{z - y}} \cdot t \]
    3. frac-2negN/A

      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(x - y\right)\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}} \cdot t \]
    4. mult-flipN/A

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

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

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

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

      \[\leadsto \frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\color{blue}{\left(x - y\right)}\right)\right)\right) \]
    9. sub-negate-revN/A

      \[\leadsto \frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \color{blue}{\left(y - x\right)}\right) \]
    10. sub-flipN/A

      \[\leadsto \frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \color{blue}{\left(y + \left(\mathsf{neg}\left(x\right)\right)\right)}\right) \]
    11. distribute-rgt-inN/A

      \[\leadsto \frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \color{blue}{\left(y \cdot t + \left(\mathsf{neg}\left(x\right)\right) \cdot t\right)} \]
    12. fp-cancel-sub-signN/A

      \[\leadsto \frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \color{blue}{\left(y \cdot t - x \cdot t\right)} \]
    13. lower-134-z0z1z2z3z4N/A

      \[\leadsto \color{blue}{\mathsf{134\_z0z1z2z3z4}\left(\left(\frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)}\right), y, t, x, t\right)} \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{134\_z0z1z2z3z4}\left(\left(\frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(\left(z - y\right)\right)}\right), y, t, x, t\right) \]
    15. frac-2neg-revN/A

      \[\leadsto \mathsf{134\_z0z1z2z3z4}\left(\color{blue}{\left(\frac{-1}{z - y}\right)}, y, t, x, t\right) \]
    16. lower-/.f6499.7%

      \[\leadsto \mathsf{134\_z0z1z2z3z4}\left(\color{blue}{\left(\frac{-1}{z - y}\right)}, y, t, x, t\right) \]
  3. Applied rewrites99.7%

    \[\leadsto \color{blue}{\mathsf{134\_z0z1z2z3z4}\left(\left(\frac{-1}{z - y}\right), y, t, x, t\right)} \]
  4. Add Preprocessing

Alternative 2: 94.4% accurate, 0.3× speedup?

\[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ t_2 := \frac{x}{z - y} \cdot t\\ \mathbf{if}\;t\_1 \leq -500000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\ \;\;\;\;\frac{x - y}{z} \cdot t\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;\frac{y}{y - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (x y z t)
  :precision binary64
  (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ x (- z y)) t)))
  (if (<= t_1 -500000000)
    t_2
    (if (<= t_1 2076918743413931/20769187434139310514121985316880384)
      (* (/ (- x y) z) t)
      (if (<= t_1 10) (* (/ y (- y z)) t) t_2)))))
double code(double x, double y, double z, double t) {
	double t_1 = (x - y) / (z - y);
	double t_2 = (x / (z - y)) * t;
	double tmp;
	if (t_1 <= -500000000.0) {
		tmp = t_2;
	} else if (t_1 <= 1e-19) {
		tmp = ((x - y) / z) * t;
	} else if (t_1 <= 10.0) {
		tmp = (y / (y - z)) * t;
	} else {
		tmp = t_2;
	}
	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(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x - y) / (z - y)
    t_2 = (x / (z - y)) * t
    if (t_1 <= (-500000000.0d0)) then
        tmp = t_2
    else if (t_1 <= 1d-19) then
        tmp = ((x - y) / z) * t
    else if (t_1 <= 10.0d0) then
        tmp = (y / (y - z)) * t
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (x - y) / (z - y);
	double t_2 = (x / (z - y)) * t;
	double tmp;
	if (t_1 <= -500000000.0) {
		tmp = t_2;
	} else if (t_1 <= 1e-19) {
		tmp = ((x - y) / z) * t;
	} else if (t_1 <= 10.0) {
		tmp = (y / (y - z)) * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (x - y) / (z - y)
	t_2 = (x / (z - y)) * t
	tmp = 0
	if t_1 <= -500000000.0:
		tmp = t_2
	elif t_1 <= 1e-19:
		tmp = ((x - y) / z) * t
	elif t_1 <= 10.0:
		tmp = (y / (y - z)) * t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(x - y) / Float64(z - y))
	t_2 = Float64(Float64(x / Float64(z - y)) * t)
	tmp = 0.0
	if (t_1 <= -500000000.0)
		tmp = t_2;
	elseif (t_1 <= 1e-19)
		tmp = Float64(Float64(Float64(x - y) / z) * t);
	elseif (t_1 <= 10.0)
		tmp = Float64(Float64(y / Float64(y - z)) * t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (x - y) / (z - y);
	t_2 = (x / (z - y)) * t;
	tmp = 0.0;
	if (t_1 <= -500000000.0)
		tmp = t_2;
	elseif (t_1 <= 1e-19)
		tmp = ((x - y) / z) * t;
	elseif (t_1 <= 10.0)
		tmp = (y / (y - z)) * t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -500000000], t$95$2, If[LessEqual[t$95$1, 2076918743413931/20769187434139310514121985316880384], N[(N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t$95$1, 10], N[(N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \frac{x - y}{z - y}\\
t_2 := \frac{x}{z - y} \cdot t\\
\mathbf{if}\;t\_1 \leq -500000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\
\;\;\;\;\frac{x - y}{z} \cdot t\\

\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;\frac{y}{y - z} \cdot t\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 x y) (-.f64 z y)) < -5e8 or 10 < (/.f64 (-.f64 x y) (-.f64 z y))

    1. Initial program 96.8%

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

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

        \[\leadsto \frac{x}{\color{blue}{z - y}} \cdot t \]
      2. lower--.f6453.1%

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

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

    if -5e8 < (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999998e-20

    1. Initial program 96.8%

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

      \[\leadsto \frac{x - y}{\color{blue}{z}} \cdot t \]
    3. Step-by-step derivation
      1. Applied rewrites50.6%

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

      if 9.9999999999999998e-20 < (/.f64 (-.f64 x y) (-.f64 z y)) < 10

      1. Initial program 96.8%

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

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

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

          \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
        4. frac-2negN/A

          \[\leadsto t \cdot \color{blue}{\frac{\mathsf{neg}\left(\left(x - y\right)\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
        5. mult-flipN/A

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right)} \]
        9. metadata-evalN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right) \]
        10. frac-2neg-revN/A

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

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

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

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

          \[\leadsto \frac{-1}{z - y} \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(x - y\right)}\right)\right) \cdot t\right) \]
        15. sub-negate-revN/A

          \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{\left(y - x\right)} \cdot t\right) \]
        16. lower--.f6484.6%

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

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

        \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{y} \cdot t\right) \]
      5. Step-by-step derivation
        1. Applied rewrites45.3%

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

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

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

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

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

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

            \[\leadsto \left(y \cdot \color{blue}{\frac{-1}{z - y}}\right) \cdot t \]
          7. frac-2negN/A

            \[\leadsto \left(y \cdot \color{blue}{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}}\right) \cdot t \]
          8. metadata-evalN/A

            \[\leadsto \left(y \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left(z - y\right)\right)}\right) \cdot t \]
          9. mult-flip-revN/A

            \[\leadsto \color{blue}{\frac{y}{\mathsf{neg}\left(\left(z - y\right)\right)}} \cdot t \]
          10. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{y}{\mathsf{neg}\left(\left(z - y\right)\right)}} \cdot t \]
          11. lift--.f64N/A

            \[\leadsto \frac{y}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)} \cdot t \]
          12. sub-negate-revN/A

            \[\leadsto \frac{y}{\color{blue}{y - z}} \cdot t \]
          13. lower--.f6454.1%

            \[\leadsto \frac{y}{\color{blue}{y - z}} \cdot t \]
        3. Applied rewrites54.1%

          \[\leadsto \color{blue}{\frac{y}{y - z} \cdot t} \]
      6. Recombined 3 regimes into one program.
      7. Add Preprocessing

      Alternative 3: 92.9% accurate, 0.3× speedup?

      \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ t_2 := \frac{x}{z - y} \cdot t\\ \mathbf{if}\;t\_1 \leq \frac{-348449143727041}{174224571863520493293247799005065324265472}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;\frac{y}{y - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
      (FPCore (x y z t)
        :precision binary64
        (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ x (- z y)) t)))
        (if (<=
             t_1
             -348449143727041/174224571863520493293247799005065324265472)
          t_2
          (if (<= t_1 2076918743413931/20769187434139310514121985316880384)
            (/ (* t (- x y)) z)
            (if (<= t_1 10) (* (/ y (- y z)) t) t_2)))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (x - y) / (z - y);
      	double t_2 = (x / (z - y)) * t;
      	double tmp;
      	if (t_1 <= -2e-27) {
      		tmp = t_2;
      	} else if (t_1 <= 1e-19) {
      		tmp = (t * (x - y)) / z;
      	} else if (t_1 <= 10.0) {
      		tmp = (y / (y - z)) * t;
      	} else {
      		tmp = t_2;
      	}
      	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(x, y, z, t)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = (x - y) / (z - y)
          t_2 = (x / (z - y)) * t
          if (t_1 <= (-2d-27)) then
              tmp = t_2
          else if (t_1 <= 1d-19) then
              tmp = (t * (x - y)) / z
          else if (t_1 <= 10.0d0) then
              tmp = (y / (y - z)) * t
          else
              tmp = t_2
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = (x - y) / (z - y);
      	double t_2 = (x / (z - y)) * t;
      	double tmp;
      	if (t_1 <= -2e-27) {
      		tmp = t_2;
      	} else if (t_1 <= 1e-19) {
      		tmp = (t * (x - y)) / z;
      	} else if (t_1 <= 10.0) {
      		tmp = (y / (y - z)) * t;
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = (x - y) / (z - y)
      	t_2 = (x / (z - y)) * t
      	tmp = 0
      	if t_1 <= -2e-27:
      		tmp = t_2
      	elif t_1 <= 1e-19:
      		tmp = (t * (x - y)) / z
      	elif t_1 <= 10.0:
      		tmp = (y / (y - z)) * t
      	else:
      		tmp = t_2
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(x - y) / Float64(z - y))
      	t_2 = Float64(Float64(x / Float64(z - y)) * t)
      	tmp = 0.0
      	if (t_1 <= -2e-27)
      		tmp = t_2;
      	elseif (t_1 <= 1e-19)
      		tmp = Float64(Float64(t * Float64(x - y)) / z);
      	elseif (t_1 <= 10.0)
      		tmp = Float64(Float64(y / Float64(y - z)) * t);
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = (x - y) / (z - y);
      	t_2 = (x / (z - y)) * t;
      	tmp = 0.0;
      	if (t_1 <= -2e-27)
      		tmp = t_2;
      	elseif (t_1 <= 1e-19)
      		tmp = (t * (x - y)) / z;
      	elseif (t_1 <= 10.0)
      		tmp = (y / (y - z)) * t;
      	else
      		tmp = t_2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -348449143727041/174224571863520493293247799005065324265472], t$95$2, If[LessEqual[t$95$1, 2076918743413931/20769187434139310514121985316880384], N[(N[(t * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 10], N[(N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$2]]]]]
      
      \begin{array}{l}
      t_1 := \frac{x - y}{z - y}\\
      t_2 := \frac{x}{z - y} \cdot t\\
      \mathbf{if}\;t\_1 \leq \frac{-348449143727041}{174224571863520493293247799005065324265472}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\
      \;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\
      
      \mathbf{elif}\;t\_1 \leq 10:\\
      \;\;\;\;\frac{y}{y - z} \cdot t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (/.f64 (-.f64 x y) (-.f64 z y)) < -2.0000000000000001e-27 or 10 < (/.f64 (-.f64 x y) (-.f64 z y))

        1. Initial program 96.8%

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

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

            \[\leadsto \frac{x}{\color{blue}{z - y}} \cdot t \]
          2. lower--.f6453.1%

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

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

        if -2.0000000000000001e-27 < (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999998e-20

        1. Initial program 96.8%

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

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

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

            \[\leadsto \frac{t \cdot \left(x - y\right)}{z} \]
          3. lower--.f6447.9%

            \[\leadsto \frac{t \cdot \left(x - y\right)}{z} \]
        4. Applied rewrites47.9%

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

        if 9.9999999999999998e-20 < (/.f64 (-.f64 x y) (-.f64 z y)) < 10

        1. Initial program 96.8%

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

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

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

            \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
          4. frac-2negN/A

            \[\leadsto t \cdot \color{blue}{\frac{\mathsf{neg}\left(\left(x - y\right)\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
          5. mult-flipN/A

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

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

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

            \[\leadsto \color{blue}{\frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right)} \]
          9. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right) \]
          10. frac-2neg-revN/A

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

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

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

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

            \[\leadsto \frac{-1}{z - y} \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(x - y\right)}\right)\right) \cdot t\right) \]
          15. sub-negate-revN/A

            \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{\left(y - x\right)} \cdot t\right) \]
          16. lower--.f6484.6%

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

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

          \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{y} \cdot t\right) \]
        5. Step-by-step derivation
          1. Applied rewrites45.3%

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

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

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

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

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

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

              \[\leadsto \left(y \cdot \color{blue}{\frac{-1}{z - y}}\right) \cdot t \]
            7. frac-2negN/A

              \[\leadsto \left(y \cdot \color{blue}{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}}\right) \cdot t \]
            8. metadata-evalN/A

              \[\leadsto \left(y \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left(z - y\right)\right)}\right) \cdot t \]
            9. mult-flip-revN/A

              \[\leadsto \color{blue}{\frac{y}{\mathsf{neg}\left(\left(z - y\right)\right)}} \cdot t \]
            10. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{y}{\mathsf{neg}\left(\left(z - y\right)\right)}} \cdot t \]
            11. lift--.f64N/A

              \[\leadsto \frac{y}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)} \cdot t \]
            12. sub-negate-revN/A

              \[\leadsto \frac{y}{\color{blue}{y - z}} \cdot t \]
            13. lower--.f6454.1%

              \[\leadsto \frac{y}{\color{blue}{y - z}} \cdot t \]
          3. Applied rewrites54.1%

            \[\leadsto \color{blue}{\frac{y}{y - z} \cdot t} \]
        6. Recombined 3 regimes into one program.
        7. Add Preprocessing

        Alternative 4: 92.5% accurate, 0.3× speedup?

        \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ \mathbf{if}\;t\_1 \leq \frac{2028240960365167}{5070602400912917605986812821504}:\\ \;\;\;\;\frac{t}{z - y} \cdot \left(x - y\right)\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;\frac{y}{y - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z - y} \cdot t\\ \end{array} \]
        (FPCore (x y z t)
          :precision binary64
          (let* ((t_1 (/ (- x y) (- z y))))
          (if (<= t_1 2028240960365167/5070602400912917605986812821504)
            (* (/ t (- z y)) (- x y))
            (if (<= t_1 10) (* (/ y (- y z)) t) (* (/ x (- z y)) t)))))
        double code(double x, double y, double z, double t) {
        	double t_1 = (x - y) / (z - y);
        	double tmp;
        	if (t_1 <= 4e-16) {
        		tmp = (t / (z - y)) * (x - y);
        	} else if (t_1 <= 10.0) {
        		tmp = (y / (y - z)) * t;
        	} else {
        		tmp = (x / (z - y)) * t;
        	}
        	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(x, y, z, t)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: t_1
            real(8) :: tmp
            t_1 = (x - y) / (z - y)
            if (t_1 <= 4d-16) then
                tmp = (t / (z - y)) * (x - y)
            else if (t_1 <= 10.0d0) then
                tmp = (y / (y - z)) * t
            else
                tmp = (x / (z - y)) * t
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = (x - y) / (z - y);
        	double tmp;
        	if (t_1 <= 4e-16) {
        		tmp = (t / (z - y)) * (x - y);
        	} else if (t_1 <= 10.0) {
        		tmp = (y / (y - z)) * t;
        	} else {
        		tmp = (x / (z - y)) * t;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = (x - y) / (z - y)
        	tmp = 0
        	if t_1 <= 4e-16:
        		tmp = (t / (z - y)) * (x - y)
        	elif t_1 <= 10.0:
        		tmp = (y / (y - z)) * t
        	else:
        		tmp = (x / (z - y)) * t
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(Float64(x - y) / Float64(z - y))
        	tmp = 0.0
        	if (t_1 <= 4e-16)
        		tmp = Float64(Float64(t / Float64(z - y)) * Float64(x - y));
        	elseif (t_1 <= 10.0)
        		tmp = Float64(Float64(y / Float64(y - z)) * t);
        	else
        		tmp = Float64(Float64(x / Float64(z - y)) * t);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = (x - y) / (z - y);
        	tmp = 0.0;
        	if (t_1 <= 4e-16)
        		tmp = (t / (z - y)) * (x - y);
        	elseif (t_1 <= 10.0)
        		tmp = (y / (y - z)) * t;
        	else
        		tmp = (x / (z - y)) * t;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2028240960365167/5070602400912917605986812821504], N[(N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10], N[(N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]]
        
        \begin{array}{l}
        t_1 := \frac{x - y}{z - y}\\
        \mathbf{if}\;t\_1 \leq \frac{2028240960365167}{5070602400912917605986812821504}:\\
        \;\;\;\;\frac{t}{z - y} \cdot \left(x - y\right)\\
        
        \mathbf{elif}\;t\_1 \leq 10:\\
        \;\;\;\;\frac{y}{y - z} \cdot t\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x}{z - y} \cdot t\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (/.f64 (-.f64 x y) (-.f64 z y)) < 3.9999999999999999e-16

          1. Initial program 96.8%

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{t}{z - y}} \cdot \left(x - y\right) \]
            9. lower-/.f6484.8%

              \[\leadsto \color{blue}{\frac{t}{z - y}} \cdot \left(x - y\right) \]
          3. Applied rewrites84.8%

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

          if 3.9999999999999999e-16 < (/.f64 (-.f64 x y) (-.f64 z y)) < 10

          1. Initial program 96.8%

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

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

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

              \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
            4. frac-2negN/A

              \[\leadsto t \cdot \color{blue}{\frac{\mathsf{neg}\left(\left(x - y\right)\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
            5. mult-flipN/A

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

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

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

              \[\leadsto \color{blue}{\frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right)} \]
            9. metadata-evalN/A

              \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right) \]
            10. frac-2neg-revN/A

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

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

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

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

              \[\leadsto \frac{-1}{z - y} \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(x - y\right)}\right)\right) \cdot t\right) \]
            15. sub-negate-revN/A

              \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{\left(y - x\right)} \cdot t\right) \]
            16. lower--.f6484.6%

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

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

            \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{y} \cdot t\right) \]
          5. Step-by-step derivation
            1. Applied rewrites45.3%

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

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

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

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

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

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

                \[\leadsto \left(y \cdot \color{blue}{\frac{-1}{z - y}}\right) \cdot t \]
              7. frac-2negN/A

                \[\leadsto \left(y \cdot \color{blue}{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}}\right) \cdot t \]
              8. metadata-evalN/A

                \[\leadsto \left(y \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(\left(z - y\right)\right)}\right) \cdot t \]
              9. mult-flip-revN/A

                \[\leadsto \color{blue}{\frac{y}{\mathsf{neg}\left(\left(z - y\right)\right)}} \cdot t \]
              10. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{y}{\mathsf{neg}\left(\left(z - y\right)\right)}} \cdot t \]
              11. lift--.f64N/A

                \[\leadsto \frac{y}{\mathsf{neg}\left(\color{blue}{\left(z - y\right)}\right)} \cdot t \]
              12. sub-negate-revN/A

                \[\leadsto \frac{y}{\color{blue}{y - z}} \cdot t \]
              13. lower--.f6454.1%

                \[\leadsto \frac{y}{\color{blue}{y - z}} \cdot t \]
            3. Applied rewrites54.1%

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

            if 10 < (/.f64 (-.f64 x y) (-.f64 z y))

            1. Initial program 96.8%

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

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

                \[\leadsto \frac{x}{\color{blue}{z - y}} \cdot t \]
              2. lower--.f6453.1%

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

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

          Alternative 5: 92.1% accurate, 0.3× speedup?

          \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ t_2 := \frac{x}{z - y} \cdot t\\ \mathbf{if}\;t\_1 \leq \frac{-348449143727041}{174224571863520493293247799005065324265472}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq \frac{4722366482869645}{4722366482869645213696}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
          (FPCore (x y z t)
            :precision binary64
            (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ x (- z y)) t)))
            (if (<=
                 t_1
                 -348449143727041/174224571863520493293247799005065324265472)
              t_2
              (if (<= t_1 4722366482869645/4722366482869645213696)
                (/ (* t (- x y)) z)
                (if (<= t_1 10) t t_2)))))
          double code(double x, double y, double z, double t) {
          	double t_1 = (x - y) / (z - y);
          	double t_2 = (x / (z - y)) * t;
          	double tmp;
          	if (t_1 <= -2e-27) {
          		tmp = t_2;
          	} else if (t_1 <= 1e-6) {
          		tmp = (t * (x - y)) / z;
          	} else if (t_1 <= 10.0) {
          		tmp = t;
          	} else {
          		tmp = t_2;
          	}
          	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(x, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: t_2
              real(8) :: tmp
              t_1 = (x - y) / (z - y)
              t_2 = (x / (z - y)) * t
              if (t_1 <= (-2d-27)) then
                  tmp = t_2
              else if (t_1 <= 1d-6) then
                  tmp = (t * (x - y)) / z
              else if (t_1 <= 10.0d0) then
                  tmp = t
              else
                  tmp = t_2
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double t_1 = (x - y) / (z - y);
          	double t_2 = (x / (z - y)) * t;
          	double tmp;
          	if (t_1 <= -2e-27) {
          		tmp = t_2;
          	} else if (t_1 <= 1e-6) {
          		tmp = (t * (x - y)) / z;
          	} else if (t_1 <= 10.0) {
          		tmp = t;
          	} else {
          		tmp = t_2;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	t_1 = (x - y) / (z - y)
          	t_2 = (x / (z - y)) * t
          	tmp = 0
          	if t_1 <= -2e-27:
          		tmp = t_2
          	elif t_1 <= 1e-6:
          		tmp = (t * (x - y)) / z
          	elif t_1 <= 10.0:
          		tmp = t
          	else:
          		tmp = t_2
          	return tmp
          
          function code(x, y, z, t)
          	t_1 = Float64(Float64(x - y) / Float64(z - y))
          	t_2 = Float64(Float64(x / Float64(z - y)) * t)
          	tmp = 0.0
          	if (t_1 <= -2e-27)
          		tmp = t_2;
          	elseif (t_1 <= 1e-6)
          		tmp = Float64(Float64(t * Float64(x - y)) / z);
          	elseif (t_1 <= 10.0)
          		tmp = t;
          	else
          		tmp = t_2;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	t_1 = (x - y) / (z - y);
          	t_2 = (x / (z - y)) * t;
          	tmp = 0.0;
          	if (t_1 <= -2e-27)
          		tmp = t_2;
          	elseif (t_1 <= 1e-6)
          		tmp = (t * (x - y)) / z;
          	elseif (t_1 <= 10.0)
          		tmp = t;
          	else
          		tmp = t_2;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, -348449143727041/174224571863520493293247799005065324265472], t$95$2, If[LessEqual[t$95$1, 4722366482869645/4722366482869645213696], N[(N[(t * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 10], t, t$95$2]]]]]
          
          \begin{array}{l}
          t_1 := \frac{x - y}{z - y}\\
          t_2 := \frac{x}{z - y} \cdot t\\
          \mathbf{if}\;t\_1 \leq \frac{-348449143727041}{174224571863520493293247799005065324265472}:\\
          \;\;\;\;t\_2\\
          
          \mathbf{elif}\;t\_1 \leq \frac{4722366482869645}{4722366482869645213696}:\\
          \;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\
          
          \mathbf{elif}\;t\_1 \leq 10:\\
          \;\;\;\;t\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_2\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (/.f64 (-.f64 x y) (-.f64 z y)) < -2.0000000000000001e-27 or 10 < (/.f64 (-.f64 x y) (-.f64 z y))

            1. Initial program 96.8%

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

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

                \[\leadsto \frac{x}{\color{blue}{z - y}} \cdot t \]
              2. lower--.f6453.1%

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

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

            if -2.0000000000000001e-27 < (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999995e-7

            1. Initial program 96.8%

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

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

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

                \[\leadsto \frac{t \cdot \left(x - y\right)}{z} \]
              3. lower--.f6447.9%

                \[\leadsto \frac{t \cdot \left(x - y\right)}{z} \]
            4. Applied rewrites47.9%

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

            if 9.9999999999999995e-7 < (/.f64 (-.f64 x y) (-.f64 z y)) < 10

            1. Initial program 96.8%

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

              \[\leadsto \color{blue}{t} \]
            3. Step-by-step derivation
              1. Applied rewrites35.1%

                \[\leadsto \color{blue}{t} \]
            4. Recombined 3 regimes into one program.
            5. Add Preprocessing

            Alternative 6: 90.4% accurate, 0.3× speedup?

            \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ t_2 := \frac{t}{z - y} \cdot x\\ \mathbf{if}\;t\_1 \leq \frac{-348449143727041}{174224571863520493293247799005065324265472}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq \frac{4722366482869645}{4722366482869645213696}:\\ \;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\ \mathbf{elif}\;t\_1 \leq 50:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
            (FPCore (x y z t)
              :precision binary64
              (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ t (- z y)) x)))
              (if (<=
                   t_1
                   -348449143727041/174224571863520493293247799005065324265472)
                t_2
                (if (<= t_1 4722366482869645/4722366482869645213696)
                  (/ (* t (- x y)) z)
                  (if (<= t_1 50) t t_2)))))
            double code(double x, double y, double z, double t) {
            	double t_1 = (x - y) / (z - y);
            	double t_2 = (t / (z - y)) * x;
            	double tmp;
            	if (t_1 <= -2e-27) {
            		tmp = t_2;
            	} else if (t_1 <= 1e-6) {
            		tmp = (t * (x - y)) / z;
            	} else if (t_1 <= 50.0) {
            		tmp = t;
            	} else {
            		tmp = t_2;
            	}
            	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(x, y, z, t)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: t_1
                real(8) :: t_2
                real(8) :: tmp
                t_1 = (x - y) / (z - y)
                t_2 = (t / (z - y)) * x
                if (t_1 <= (-2d-27)) then
                    tmp = t_2
                else if (t_1 <= 1d-6) then
                    tmp = (t * (x - y)) / z
                else if (t_1 <= 50.0d0) then
                    tmp = t
                else
                    tmp = t_2
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double t_1 = (x - y) / (z - y);
            	double t_2 = (t / (z - y)) * x;
            	double tmp;
            	if (t_1 <= -2e-27) {
            		tmp = t_2;
            	} else if (t_1 <= 1e-6) {
            		tmp = (t * (x - y)) / z;
            	} else if (t_1 <= 50.0) {
            		tmp = t;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	t_1 = (x - y) / (z - y)
            	t_2 = (t / (z - y)) * x
            	tmp = 0
            	if t_1 <= -2e-27:
            		tmp = t_2
            	elif t_1 <= 1e-6:
            		tmp = (t * (x - y)) / z
            	elif t_1 <= 50.0:
            		tmp = t
            	else:
            		tmp = t_2
            	return tmp
            
            function code(x, y, z, t)
            	t_1 = Float64(Float64(x - y) / Float64(z - y))
            	t_2 = Float64(Float64(t / Float64(z - y)) * x)
            	tmp = 0.0
            	if (t_1 <= -2e-27)
            		tmp = t_2;
            	elseif (t_1 <= 1e-6)
            		tmp = Float64(Float64(t * Float64(x - y)) / z);
            	elseif (t_1 <= 50.0)
            		tmp = t;
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	t_1 = (x - y) / (z - y);
            	t_2 = (t / (z - y)) * x;
            	tmp = 0.0;
            	if (t_1 <= -2e-27)
            		tmp = t_2;
            	elseif (t_1 <= 1e-6)
            		tmp = (t * (x - y)) / z;
            	elseif (t_1 <= 50.0)
            		tmp = t;
            	else
            		tmp = t_2;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, -348449143727041/174224571863520493293247799005065324265472], t$95$2, If[LessEqual[t$95$1, 4722366482869645/4722366482869645213696], N[(N[(t * N[(x - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 50], t, t$95$2]]]]]
            
            \begin{array}{l}
            t_1 := \frac{x - y}{z - y}\\
            t_2 := \frac{t}{z - y} \cdot x\\
            \mathbf{if}\;t\_1 \leq \frac{-348449143727041}{174224571863520493293247799005065324265472}:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;t\_1 \leq \frac{4722366482869645}{4722366482869645213696}:\\
            \;\;\;\;\frac{t \cdot \left(x - y\right)}{z}\\
            
            \mathbf{elif}\;t\_1 \leq 50:\\
            \;\;\;\;t\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (/.f64 (-.f64 x y) (-.f64 z y)) < -2.0000000000000001e-27 or 50 < (/.f64 (-.f64 x y) (-.f64 z y))

              1. Initial program 96.8%

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

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

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

                  \[\leadsto \frac{t \cdot x}{\color{blue}{z} - y} \]
                3. lower--.f6450.3%

                  \[\leadsto \frac{t \cdot x}{z - \color{blue}{y}} \]
              4. Applied rewrites50.3%

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

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

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

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

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

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

                  \[\leadsto \frac{t}{z - y} \cdot \color{blue}{x} \]
                7. lower-/.f6450.4%

                  \[\leadsto \frac{t}{z - y} \cdot x \]
              6. Applied rewrites50.4%

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

              if -2.0000000000000001e-27 < (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999995e-7

              1. Initial program 96.8%

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

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

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

                  \[\leadsto \frac{t \cdot \left(x - y\right)}{z} \]
                3. lower--.f6447.9%

                  \[\leadsto \frac{t \cdot \left(x - y\right)}{z} \]
              4. Applied rewrites47.9%

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

              if 9.9999999999999995e-7 < (/.f64 (-.f64 x y) (-.f64 z y)) < 50

              1. Initial program 96.8%

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

                \[\leadsto \color{blue}{t} \]
              3. Step-by-step derivation
                1. Applied rewrites35.1%

                  \[\leadsto \color{blue}{t} \]
              4. Recombined 3 regimes into one program.
              5. Add Preprocessing

              Alternative 7: 80.6% accurate, 0.3× speedup?

              \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ t_2 := \frac{t}{z - y} \cdot x\\ \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 50:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
              (FPCore (x y z t)
                :precision binary64
                (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ t (- z y)) x)))
                (if (<= t_1 2076918743413931/20769187434139310514121985316880384)
                  t_2
                  (if (<= t_1 50) t t_2))))
              double code(double x, double y, double z, double t) {
              	double t_1 = (x - y) / (z - y);
              	double t_2 = (t / (z - y)) * x;
              	double tmp;
              	if (t_1 <= 1e-19) {
              		tmp = t_2;
              	} else if (t_1 <= 50.0) {
              		tmp = t;
              	} else {
              		tmp = t_2;
              	}
              	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(x, y, z, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: t_1
                  real(8) :: t_2
                  real(8) :: tmp
                  t_1 = (x - y) / (z - y)
                  t_2 = (t / (z - y)) * x
                  if (t_1 <= 1d-19) then
                      tmp = t_2
                  else if (t_1 <= 50.0d0) then
                      tmp = t
                  else
                      tmp = t_2
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double t_1 = (x - y) / (z - y);
              	double t_2 = (t / (z - y)) * x;
              	double tmp;
              	if (t_1 <= 1e-19) {
              		tmp = t_2;
              	} else if (t_1 <= 50.0) {
              		tmp = t;
              	} else {
              		tmp = t_2;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = (x - y) / (z - y)
              	t_2 = (t / (z - y)) * x
              	tmp = 0
              	if t_1 <= 1e-19:
              		tmp = t_2
              	elif t_1 <= 50.0:
              		tmp = t
              	else:
              		tmp = t_2
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(Float64(x - y) / Float64(z - y))
              	t_2 = Float64(Float64(t / Float64(z - y)) * x)
              	tmp = 0.0
              	if (t_1 <= 1e-19)
              		tmp = t_2;
              	elseif (t_1 <= 50.0)
              		tmp = t;
              	else
              		tmp = t_2;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = (x - y) / (z - y);
              	t_2 = (t / (z - y)) * x;
              	tmp = 0.0;
              	if (t_1 <= 1e-19)
              		tmp = t_2;
              	elseif (t_1 <= 50.0)
              		tmp = t;
              	else
              		tmp = t_2;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, 2076918743413931/20769187434139310514121985316880384], t$95$2, If[LessEqual[t$95$1, 50], t, t$95$2]]]]
              
              \begin{array}{l}
              t_1 := \frac{x - y}{z - y}\\
              t_2 := \frac{t}{z - y} \cdot x\\
              \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\
              \;\;\;\;t\_2\\
              
              \mathbf{elif}\;t\_1 \leq 50:\\
              \;\;\;\;t\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_2\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999998e-20 or 50 < (/.f64 (-.f64 x y) (-.f64 z y))

                1. Initial program 96.8%

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

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

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

                    \[\leadsto \frac{t \cdot x}{\color{blue}{z} - y} \]
                  3. lower--.f6450.3%

                    \[\leadsto \frac{t \cdot x}{z - \color{blue}{y}} \]
                4. Applied rewrites50.3%

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

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

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

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

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

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

                    \[\leadsto \frac{t}{z - y} \cdot \color{blue}{x} \]
                  7. lower-/.f6450.4%

                    \[\leadsto \frac{t}{z - y} \cdot x \]
                6. Applied rewrites50.4%

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

                if 9.9999999999999998e-20 < (/.f64 (-.f64 x y) (-.f64 z y)) < 50

                1. Initial program 96.8%

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

                  \[\leadsto \color{blue}{t} \]
                3. Step-by-step derivation
                  1. Applied rewrites35.1%

                    \[\leadsto \color{blue}{t} \]
                4. Recombined 2 regimes into one program.
                5. Add Preprocessing

                Alternative 8: 70.2% accurate, 0.4× speedup?

                \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ t_2 := \frac{x}{z} \cdot t\\ \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
                (FPCore (x y z t)
                  :precision binary64
                  (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ x z) t)))
                  (if (<= t_1 2076918743413931/20769187434139310514121985316880384)
                    t_2
                    (if (<= t_1 10) t t_2))))
                double code(double x, double y, double z, double t) {
                	double t_1 = (x - y) / (z - y);
                	double t_2 = (x / z) * t;
                	double tmp;
                	if (t_1 <= 1e-19) {
                		tmp = t_2;
                	} else if (t_1 <= 10.0) {
                		tmp = t;
                	} else {
                		tmp = t_2;
                	}
                	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(x, y, z, t)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8) :: t_1
                    real(8) :: t_2
                    real(8) :: tmp
                    t_1 = (x - y) / (z - y)
                    t_2 = (x / z) * t
                    if (t_1 <= 1d-19) then
                        tmp = t_2
                    else if (t_1 <= 10.0d0) then
                        tmp = t
                    else
                        tmp = t_2
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t) {
                	double t_1 = (x - y) / (z - y);
                	double t_2 = (x / z) * t;
                	double tmp;
                	if (t_1 <= 1e-19) {
                		tmp = t_2;
                	} else if (t_1 <= 10.0) {
                		tmp = t;
                	} else {
                		tmp = t_2;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	t_1 = (x - y) / (z - y)
                	t_2 = (x / z) * t
                	tmp = 0
                	if t_1 <= 1e-19:
                		tmp = t_2
                	elif t_1 <= 10.0:
                		tmp = t
                	else:
                		tmp = t_2
                	return tmp
                
                function code(x, y, z, t)
                	t_1 = Float64(Float64(x - y) / Float64(z - y))
                	t_2 = Float64(Float64(x / z) * t)
                	tmp = 0.0
                	if (t_1 <= 1e-19)
                		tmp = t_2;
                	elseif (t_1 <= 10.0)
                		tmp = t;
                	else
                		tmp = t_2;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t)
                	t_1 = (x - y) / (z - y);
                	t_2 = (x / z) * t;
                	tmp = 0.0;
                	if (t_1 <= 1e-19)
                		tmp = t_2;
                	elseif (t_1 <= 10.0)
                		tmp = t;
                	else
                		tmp = t_2;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t$95$1, 2076918743413931/20769187434139310514121985316880384], t$95$2, If[LessEqual[t$95$1, 10], t, t$95$2]]]]
                
                \begin{array}{l}
                t_1 := \frac{x - y}{z - y}\\
                t_2 := \frac{x}{z} \cdot t\\
                \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\
                \;\;\;\;t\_2\\
                
                \mathbf{elif}\;t\_1 \leq 10:\\
                \;\;\;\;t\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_2\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999998e-20 or 10 < (/.f64 (-.f64 x y) (-.f64 z y))

                  1. Initial program 96.8%

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

                    \[\leadsto \frac{x - y}{\color{blue}{z}} \cdot t \]
                  3. Step-by-step derivation
                    1. Applied rewrites50.6%

                      \[\leadsto \frac{x - y}{\color{blue}{z}} \cdot t \]
                    2. Taylor expanded in y around 0

                      \[\leadsto \color{blue}{\frac{x}{z}} \cdot t \]
                    3. Step-by-step derivation
                      1. lower-/.f6440.2%

                        \[\leadsto \frac{x}{\color{blue}{z}} \cdot t \]
                    4. Applied rewrites40.2%

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

                    if 9.9999999999999998e-20 < (/.f64 (-.f64 x y) (-.f64 z y)) < 10

                    1. Initial program 96.8%

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

                      \[\leadsto \color{blue}{t} \]
                    3. Step-by-step derivation
                      1. Applied rewrites35.1%

                        \[\leadsto \color{blue}{t} \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 9: 68.5% accurate, 0.4× speedup?

                    \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\ \;\;\;\;\frac{t}{z} \cdot x\\ \mathbf{elif}\;t\_1 \leq 10:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \end{array} \]
                    (FPCore (x y z t)
                      :precision binary64
                      (let* ((t_1 (/ (- x y) (- z y))))
                      (if (<= t_1 2076918743413931/20769187434139310514121985316880384)
                        (* (/ t z) x)
                        (if (<= t_1 10) t (/ (* t x) z)))))
                    double code(double x, double y, double z, double t) {
                    	double t_1 = (x - y) / (z - y);
                    	double tmp;
                    	if (t_1 <= 1e-19) {
                    		tmp = (t / z) * x;
                    	} else if (t_1 <= 10.0) {
                    		tmp = t;
                    	} else {
                    		tmp = (t * x) / z;
                    	}
                    	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(x, y, z, t)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8) :: t_1
                        real(8) :: tmp
                        t_1 = (x - y) / (z - y)
                        if (t_1 <= 1d-19) then
                            tmp = (t / z) * x
                        else if (t_1 <= 10.0d0) then
                            tmp = t
                        else
                            tmp = (t * x) / z
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	double t_1 = (x - y) / (z - y);
                    	double tmp;
                    	if (t_1 <= 1e-19) {
                    		tmp = (t / z) * x;
                    	} else if (t_1 <= 10.0) {
                    		tmp = t;
                    	} else {
                    		tmp = (t * x) / z;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t):
                    	t_1 = (x - y) / (z - y)
                    	tmp = 0
                    	if t_1 <= 1e-19:
                    		tmp = (t / z) * x
                    	elif t_1 <= 10.0:
                    		tmp = t
                    	else:
                    		tmp = (t * x) / z
                    	return tmp
                    
                    function code(x, y, z, t)
                    	t_1 = Float64(Float64(x - y) / Float64(z - y))
                    	tmp = 0.0
                    	if (t_1 <= 1e-19)
                    		tmp = Float64(Float64(t / z) * x);
                    	elseif (t_1 <= 10.0)
                    		tmp = t;
                    	else
                    		tmp = Float64(Float64(t * x) / z);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t)
                    	t_1 = (x - y) / (z - y);
                    	tmp = 0.0;
                    	if (t_1 <= 1e-19)
                    		tmp = (t / z) * x;
                    	elseif (t_1 <= 10.0)
                    		tmp = t;
                    	else
                    		tmp = (t * x) / z;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2076918743413931/20769187434139310514121985316880384], N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 10], t, N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    t_1 := \frac{x - y}{z - y}\\
                    \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\
                    \;\;\;\;\frac{t}{z} \cdot x\\
                    
                    \mathbf{elif}\;t\_1 \leq 10:\\
                    \;\;\;\;t\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{t \cdot x}{z}\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999998e-20

                      1. Initial program 96.8%

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

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

                          \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                        2. lower-*.f6438.2%

                          \[\leadsto \frac{t \cdot x}{z} \]
                      4. Applied rewrites38.2%

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{t}{z} \cdot x \]
                        9. lower-/.f6438.2%

                          \[\leadsto \frac{t}{z} \cdot x \]
                      6. Applied rewrites38.2%

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

                      if 9.9999999999999998e-20 < (/.f64 (-.f64 x y) (-.f64 z y)) < 10

                      1. Initial program 96.8%

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

                        \[\leadsto \color{blue}{t} \]
                      3. Step-by-step derivation
                        1. Applied rewrites35.1%

                          \[\leadsto \color{blue}{t} \]

                        if 10 < (/.f64 (-.f64 x y) (-.f64 z y))

                        1. Initial program 96.8%

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

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

                            \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                          2. lower-*.f6438.2%

                            \[\leadsto \frac{t \cdot x}{z} \]
                        4. Applied rewrites38.2%

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

                      Alternative 10: 68.4% accurate, 0.4× speedup?

                      \[\begin{array}{l} t_1 := \frac{x - y}{z - y}\\ t_2 := \frac{t}{z} \cdot x\\ \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 50:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
                      (FPCore (x y z t)
                        :precision binary64
                        (let* ((t_1 (/ (- x y) (- z y))) (t_2 (* (/ t z) x)))
                        (if (<= t_1 2076918743413931/20769187434139310514121985316880384)
                          t_2
                          (if (<= t_1 50) t t_2))))
                      double code(double x, double y, double z, double t) {
                      	double t_1 = (x - y) / (z - y);
                      	double t_2 = (t / z) * x;
                      	double tmp;
                      	if (t_1 <= 1e-19) {
                      		tmp = t_2;
                      	} else if (t_1 <= 50.0) {
                      		tmp = t;
                      	} else {
                      		tmp = t_2;
                      	}
                      	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(x, y, z, t)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: t
                          real(8) :: t_1
                          real(8) :: t_2
                          real(8) :: tmp
                          t_1 = (x - y) / (z - y)
                          t_2 = (t / z) * x
                          if (t_1 <= 1d-19) then
                              tmp = t_2
                          else if (t_1 <= 50.0d0) then
                              tmp = t
                          else
                              tmp = t_2
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double t_1 = (x - y) / (z - y);
                      	double t_2 = (t / z) * x;
                      	double tmp;
                      	if (t_1 <= 1e-19) {
                      		tmp = t_2;
                      	} else if (t_1 <= 50.0) {
                      		tmp = t;
                      	} else {
                      		tmp = t_2;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	t_1 = (x - y) / (z - y)
                      	t_2 = (t / z) * x
                      	tmp = 0
                      	if t_1 <= 1e-19:
                      		tmp = t_2
                      	elif t_1 <= 50.0:
                      		tmp = t
                      	else:
                      		tmp = t_2
                      	return tmp
                      
                      function code(x, y, z, t)
                      	t_1 = Float64(Float64(x - y) / Float64(z - y))
                      	t_2 = Float64(Float64(t / z) * x)
                      	tmp = 0.0
                      	if (t_1 <= 1e-19)
                      		tmp = t_2;
                      	elseif (t_1 <= 50.0)
                      		tmp = t;
                      	else
                      		tmp = t_2;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	t_1 = (x - y) / (z - y);
                      	t_2 = (t / z) * x;
                      	tmp = 0.0;
                      	if (t_1 <= 1e-19)
                      		tmp = t_2;
                      	elseif (t_1 <= 50.0)
                      		tmp = t;
                      	else
                      		tmp = t_2;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, 2076918743413931/20769187434139310514121985316880384], t$95$2, If[LessEqual[t$95$1, 50], t, t$95$2]]]]
                      
                      \begin{array}{l}
                      t_1 := \frac{x - y}{z - y}\\
                      t_2 := \frac{t}{z} \cdot x\\
                      \mathbf{if}\;t\_1 \leq \frac{2076918743413931}{20769187434139310514121985316880384}:\\
                      \;\;\;\;t\_2\\
                      
                      \mathbf{elif}\;t\_1 \leq 50:\\
                      \;\;\;\;t\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_2\\
                      
                      
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999998e-20 or 50 < (/.f64 (-.f64 x y) (-.f64 z y))

                        1. Initial program 96.8%

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

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

                            \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                          2. lower-*.f6438.2%

                            \[\leadsto \frac{t \cdot x}{z} \]
                        4. Applied rewrites38.2%

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{t}{z} \cdot x \]
                          9. lower-/.f6438.2%

                            \[\leadsto \frac{t}{z} \cdot x \]
                        6. Applied rewrites38.2%

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

                        if 9.9999999999999998e-20 < (/.f64 (-.f64 x y) (-.f64 z y)) < 50

                        1. Initial program 96.8%

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

                          \[\leadsto \color{blue}{t} \]
                        3. Step-by-step derivation
                          1. Applied rewrites35.1%

                            \[\leadsto \color{blue}{t} \]
                        4. Recombined 2 regimes into one program.
                        5. Add Preprocessing

                        Alternative 11: 39.1% accurate, 0.1× speedup?

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

                          1. Initial program 96.8%

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

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

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

                              \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
                            4. frac-2negN/A

                              \[\leadsto t \cdot \color{blue}{\frac{\mathsf{neg}\left(\left(x - y\right)\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
                            5. mult-flipN/A

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

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

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

                              \[\leadsto \color{blue}{\frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right)} \]
                            9. metadata-evalN/A

                              \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right) \]
                            10. frac-2neg-revN/A

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

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

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

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

                              \[\leadsto \frac{-1}{z - y} \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(x - y\right)}\right)\right) \cdot t\right) \]
                            15. sub-negate-revN/A

                              \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{\left(y - x\right)} \cdot t\right) \]
                            16. lower--.f6484.6%

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

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

                            \[\leadsto \color{blue}{\frac{t \cdot \left(y - x\right)}{y}} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

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

                              \[\leadsto \frac{t \cdot \left(y - x\right)}{y} \]
                            3. lower--.f6445.1%

                              \[\leadsto \frac{t \cdot \left(y - x\right)}{y} \]
                          6. Applied rewrites45.1%

                            \[\leadsto \color{blue}{\frac{t \cdot \left(y - x\right)}{y}} \]
                          7. Taylor expanded in x around 0

                            \[\leadsto \frac{t \cdot y}{y} \]
                          8. Step-by-step derivation
                            1. Applied rewrites31.0%

                              \[\leadsto \frac{t \cdot y}{y} \]

                            if 4.9999999999999997e-50 < (*.f64 (/.f64 (-.f64 x y) (-.f64 z y)) t)

                            1. Initial program 96.8%

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

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

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

                                \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
                              4. frac-2negN/A

                                \[\leadsto t \cdot \color{blue}{\frac{\mathsf{neg}\left(\left(x - y\right)\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
                              5. mult-flipN/A

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

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

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

                                \[\leadsto \color{blue}{\frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right)} \]
                              9. metadata-evalN/A

                                \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right) \]
                              10. frac-2neg-revN/A

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

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

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

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

                                \[\leadsto \frac{-1}{z - y} \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(x - y\right)}\right)\right) \cdot t\right) \]
                              15. sub-negate-revN/A

                                \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{\left(y - x\right)} \cdot t\right) \]
                              16. lower--.f6484.6%

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

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

                              \[\leadsto \color{blue}{\frac{t \cdot \left(y - x\right)}{y}} \]
                            5. Step-by-step derivation
                              1. lower-/.f64N/A

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

                                \[\leadsto \frac{t \cdot \left(y - x\right)}{y} \]
                              3. lower--.f6445.1%

                                \[\leadsto \frac{t \cdot \left(y - x\right)}{y} \]
                            6. Applied rewrites45.1%

                              \[\leadsto \color{blue}{\frac{t \cdot \left(y - x\right)}{y}} \]
                            7. Taylor expanded in x around 0

                              \[\leadsto \frac{t \cdot y}{y} \]
                            8. Step-by-step derivation
                              1. Applied rewrites31.0%

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

                                  \[\leadsto \frac{t \cdot y}{y} \]
                                2. lift-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{t} \cdot y}{y} \]
                                3. *-commutativeN/A

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

                                  \[\leadsto \frac{t \cdot \color{blue}{y}}{y} \]
                                5. frac-2negN/A

                                  \[\leadsto \frac{t \cdot \color{blue}{y}}{y} \]
                                6. metadata-evalN/A

                                  \[\leadsto \frac{t \cdot y}{y} \]
                                7. mult-flip-revN/A

                                  \[\leadsto \frac{\color{blue}{t \cdot y}}{y} \]
                                8. associate-*l/N/A

                                  \[\leadsto \frac{\color{blue}{t \cdot y}}{y} \]
                                9. distribute-frac-neg2N/A

                                  \[\leadsto \frac{\color{blue}{t} \cdot y}{y} \]
                                10. distribute-frac-negN/A

                                  \[\leadsto \frac{\color{blue}{t} \cdot y}{y} \]
                                11. sub-negate-revN/A

                                  \[\leadsto \frac{t \cdot y}{y} \]
                                12. lift--.f6431.0%

                                  \[\leadsto \frac{t \cdot y}{y} \]
                                13. lift-/.f64N/A

                                  \[\leadsto \frac{t \cdot y}{\color{blue}{y}} \]
                                14. mult-flipN/A

                                  \[\leadsto \left(t \cdot y\right) \cdot \color{blue}{\frac{1}{y}} \]
                                15. lift-*.f64N/A

                                  \[\leadsto \left(t \cdot y\right) \cdot \frac{\color{blue}{1}}{y} \]
                                16. *-commutativeN/A

                                  \[\leadsto \left(y \cdot t\right) \cdot \frac{\color{blue}{1}}{y} \]
                                17. associate-*l*N/A

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

                                  \[\leadsto \left(t \cdot \frac{1}{y}\right) \cdot \color{blue}{y} \]
                                19. lower-*.f64N/A

                                  \[\leadsto \left(t \cdot \frac{1}{y}\right) \cdot \color{blue}{y} \]
                                20. mult-flip-revN/A

                                  \[\leadsto \frac{t}{y} \cdot y \]
                                21. lower-/.f6429.5%

                                  \[\leadsto \frac{t}{y} \cdot y \]
                              3. Applied rewrites29.5%

                                \[\leadsto \color{blue}{\frac{t}{y} \cdot y} \]
                            9. Recombined 2 regimes into one program.
                            10. Add Preprocessing

                            Alternative 12: 38.7% accurate, 0.6× speedup?

                            \[\begin{array}{l} \mathbf{if}\;\frac{x - y}{z - y} \leq \frac{1942668892225729}{1942668892225729070919461906823518906642406839052139521251812409738904285205208498176}:\\ \;\;\;\;\frac{t \cdot y}{y}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                            (FPCore (x y z t)
                              :precision binary64
                              (if (<=
                                 (/ (- x y) (- z y))
                                 1942668892225729/1942668892225729070919461906823518906642406839052139521251812409738904285205208498176)
                              (/ (* t y) y)
                              t))
                            double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (((x - y) / (z - y)) <= 1e-69) {
                            		tmp = (t * y) / y;
                            	} else {
                            		tmp = t;
                            	}
                            	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(x, y, z, t)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8) :: tmp
                                if (((x - y) / (z - y)) <= 1d-69) then
                                    tmp = (t * y) / y
                                else
                                    tmp = t
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (((x - y) / (z - y)) <= 1e-69) {
                            		tmp = (t * y) / y;
                            	} else {
                            		tmp = t;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t):
                            	tmp = 0
                            	if ((x - y) / (z - y)) <= 1e-69:
                            		tmp = (t * y) / y
                            	else:
                            		tmp = t
                            	return tmp
                            
                            function code(x, y, z, t)
                            	tmp = 0.0
                            	if (Float64(Float64(x - y) / Float64(z - y)) <= 1e-69)
                            		tmp = Float64(Float64(t * y) / y);
                            	else
                            		tmp = t;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t)
                            	tmp = 0.0;
                            	if (((x - y) / (z - y)) <= 1e-69)
                            		tmp = (t * y) / y;
                            	else
                            		tmp = t;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_, t_] := If[LessEqual[N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], 1942668892225729/1942668892225729070919461906823518906642406839052139521251812409738904285205208498176], N[(N[(t * y), $MachinePrecision] / y), $MachinePrecision], t]
                            
                            \begin{array}{l}
                            \mathbf{if}\;\frac{x - y}{z - y} \leq \frac{1942668892225729}{1942668892225729070919461906823518906642406839052139521251812409738904285205208498176}:\\
                            \;\;\;\;\frac{t \cdot y}{y}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\\
                            
                            
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (/.f64 (-.f64 x y) (-.f64 z y)) < 9.9999999999999996e-70

                              1. Initial program 96.8%

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

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

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

                                  \[\leadsto t \cdot \color{blue}{\frac{x - y}{z - y}} \]
                                4. frac-2negN/A

                                  \[\leadsto t \cdot \color{blue}{\frac{\mathsf{neg}\left(\left(x - y\right)\right)}{\mathsf{neg}\left(\left(z - y\right)\right)}} \]
                                5. mult-flipN/A

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

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

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

                                  \[\leadsto \color{blue}{\frac{1}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right)} \]
                                9. metadata-evalN/A

                                  \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(-1\right)}}{\mathsf{neg}\left(\left(z - y\right)\right)} \cdot \left(t \cdot \left(\mathsf{neg}\left(\left(x - y\right)\right)\right)\right) \]
                                10. frac-2neg-revN/A

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

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

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

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

                                  \[\leadsto \frac{-1}{z - y} \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(x - y\right)}\right)\right) \cdot t\right) \]
                                15. sub-negate-revN/A

                                  \[\leadsto \frac{-1}{z - y} \cdot \left(\color{blue}{\left(y - x\right)} \cdot t\right) \]
                                16. lower--.f6484.6%

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

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

                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - x\right)}{y}} \]
                              5. Step-by-step derivation
                                1. lower-/.f64N/A

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

                                  \[\leadsto \frac{t \cdot \left(y - x\right)}{y} \]
                                3. lower--.f6445.1%

                                  \[\leadsto \frac{t \cdot \left(y - x\right)}{y} \]
                              6. Applied rewrites45.1%

                                \[\leadsto \color{blue}{\frac{t \cdot \left(y - x\right)}{y}} \]
                              7. Taylor expanded in x around 0

                                \[\leadsto \frac{t \cdot y}{y} \]
                              8. Step-by-step derivation
                                1. Applied rewrites31.0%

                                  \[\leadsto \frac{t \cdot y}{y} \]

                                if 9.9999999999999996e-70 < (/.f64 (-.f64 x y) (-.f64 z y))

                                1. Initial program 96.8%

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

                                  \[\leadsto \color{blue}{t} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites35.1%

                                    \[\leadsto \color{blue}{t} \]
                                4. Recombined 2 regimes into one program.
                                5. Add Preprocessing

                                Alternative 13: 35.1% accurate, 23.0× speedup?

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

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

                                  \[\leadsto \color{blue}{t} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites35.1%

                                    \[\leadsto \color{blue}{t} \]
                                  2. Add Preprocessing

                                  Reproduce

                                  ?
                                  herbie shell --seed 2025271 -o generate:evaluate
                                  (FPCore (x y z t)
                                    :name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
                                    :precision binary64
                                    (* (/ (- x y) (- z y)) t))