Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3

Percentage Accurate: 83.9% → 96.9%
Time: 15.6s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

real(8) function code(x, y, z, 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)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
def code(x, y, z, t):
	return (x * (y - z)) / (t - z)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(y - z)) / Float64(t - z))
end
function tmp = code(x, y, z, t)
	tmp = (x * (y - z)) / (t - z);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 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: 83.9% accurate, 1.0× speedup?

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

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

real(8) function code(x, y, z, 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)) / (t - z)
end function
public static double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
def code(x, y, z, t):
	return (x * (y - z)) / (t - z)
function code(x, y, z, t)
	return Float64(Float64(x * Float64(y - z)) / Float64(t - z))
end
function tmp = code(x, y, z, t)
	tmp = (x * (y - z)) / (t - z);
end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}

Alternative 1: 96.9% accurate, 0.6× speedup?

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

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

real(8) function code(x, y, z, 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 * ((z / (t - z)) - (y / (t - z)))
end function
public static double code(double x, double y, double z, double t) {
	return -x * ((z / (t - z)) - (y / (t - z)));
}
def code(x, y, z, t):
	return -x * ((z / (t - z)) - (y / (t - z)))
function code(x, y, z, t)
	return Float64(Float64(-x) * Float64(Float64(z / Float64(t - z)) - Float64(y / Float64(t - z))))
end
function tmp = code(x, y, z, t)
	tmp = -x * ((z / (t - z)) - (y / (t - z)));
end
code[x_, y_, z_, t_] := N[((-x) * N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] - N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x\right) \cdot \left(\frac{z}{t - z} - \frac{y}{t - z}\right)
\end{array}
Derivation
  1. Initial program 83.9%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
    6. div-subN/A

      \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)} \]
    7. distribute-lft-out--N/A

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

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

      \[\leadsto \frac{x \cdot y}{t - z} - \color{blue}{\frac{x \cdot z}{t - z}} \]
    10. div-subN/A

      \[\leadsto \color{blue}{\frac{x \cdot y - x \cdot z}{t - z}} \]
    11. fp-cancel-sub-signN/A

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

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

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

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

      \[\leadsto \frac{-1 \cdot \left(x \cdot z\right) + \color{blue}{y \cdot x}}{t - z} \]
    16. fp-cancel-sign-sub-invN/A

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

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

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

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

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

Alternative 2: 96.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{y - z}{t - z} \cdot x \end{array} \]
(FPCore (x y z t) :precision binary64 (* (/ (- y z) (- t z)) x))
double code(double x, double y, double z, double t) {
	return ((y - z) / (t - z)) * x;
}
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 = ((y - z) / (t - z)) * x
end function
public static double code(double x, double y, double z, double t) {
	return ((y - z) / (t - z)) * x;
}
def code(x, y, z, t):
	return ((y - z) / (t - z)) * x
function code(x, y, z, t)
	return Float64(Float64(Float64(y - z) / Float64(t - z)) * x)
end
function tmp = code(x, y, z, t)
	tmp = ((y - z) / (t - z)) * x;
end
code[x_, y_, z_, t_] := N[(N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}

\\
\frac{y - z}{t - z} \cdot x
\end{array}
Derivation
  1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{y - z}}{t - z} \cdot x \]
    10. lift--.f6496.9

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

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

Alternative 3: 90.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+162}:\\ \;\;\;\;\frac{z}{t - z} \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+149}:\\ \;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z} \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.35e+162)
   (* (/ z (- t z)) (- x))
   (if (<= z 5.6e+149) (* (/ x (- t z)) (- y z)) (- x (* (/ y z) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.35e+162) {
		tmp = (z / (t - z)) * -x;
	} else if (z <= 5.6e+149) {
		tmp = (x / (t - z)) * (y - z);
	} else {
		tmp = x - ((y / z) * x);
	}
	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 (z <= (-1.35d+162)) then
        tmp = (z / (t - z)) * -x
    else if (z <= 5.6d+149) then
        tmp = (x / (t - z)) * (y - z)
    else
        tmp = x - ((y / z) * x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.35e+162) {
		tmp = (z / (t - z)) * -x;
	} else if (z <= 5.6e+149) {
		tmp = (x / (t - z)) * (y - z);
	} else {
		tmp = x - ((y / z) * x);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.35e+162:
		tmp = (z / (t - z)) * -x
	elif z <= 5.6e+149:
		tmp = (x / (t - z)) * (y - z)
	else:
		tmp = x - ((y / z) * x)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.35e+162)
		tmp = Float64(Float64(z / Float64(t - z)) * Float64(-x));
	elseif (z <= 5.6e+149)
		tmp = Float64(Float64(x / Float64(t - z)) * Float64(y - z));
	else
		tmp = Float64(x - Float64(Float64(y / z) * x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.35e+162)
		tmp = (z / (t - z)) * -x;
	elseif (z <= 5.6e+149)
		tmp = (x / (t - z)) * (y - z);
	else
		tmp = x - ((y / z) * x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e+162], N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[z, 5.6e+149], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+162}:\\
\;\;\;\;\frac{z}{t - z} \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+149}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3500000000000001e162

    1. Initial program 61.2%

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

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

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

        \[\leadsto \mathsf{neg}\left(x \cdot \frac{z}{t - z}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\frac{z}{t - z} \cdot x\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

        \[\leadsto \frac{z}{t - z} \cdot \left(-1 \cdot x\right) \]
      9. mul-1-negN/A

        \[\leadsto \frac{z}{t - z} \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      10. lower-neg.f6488.4

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

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

    if -1.3500000000000001e162 < z < 5.5999999999999998e149

    1. Initial program 90.8%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
      6. div-subN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)} \]
      7. distribute-lft-out--N/A

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{t - z} - \color{blue}{z \cdot \frac{x}{t - z}} \]
      14. distribute-rgt-out--N/A

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

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

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

        \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot \left(y - z\right) \]
      18. lift--.f6491.0

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

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

    if 5.5999999999999998e149 < z

    1. Initial program 64.5%

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

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

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

        \[\leadsto \mathsf{neg}\left(x \cdot \frac{y - z}{z}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\frac{y - z}{z} \cdot x\right) \]
      4. distribute-lft-neg-outN/A

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

        \[\leadsto \left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot \color{blue}{x} \]
      6. distribute-neg-fracN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z} \cdot x \]
      8. *-lft-identityN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y - 1 \cdot z\right)\right)}{z} \cdot x \]
      9. cancel-sign-sub-invN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(y + -1 \cdot z\right)\right)}{z} \cdot x \]
      11. mul-1-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)\right)}{z} \cdot x \]
      12. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)\right)}{z} \cdot x \]
      13. distribute-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      14. mul-1-negN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      15. distribute-lft-neg-outN/A

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

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

        \[\leadsto \frac{z + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
      18. mul-1-negN/A

        \[\leadsto \frac{z + -1 \cdot y}{z} \cdot x \]
      19. metadata-evalN/A

        \[\leadsto \frac{z + \left(\mathsf{neg}\left(1\right)\right) \cdot y}{z} \cdot x \]
      20. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{z - 1 \cdot y}{z} \cdot x \]
      21. *-lft-identityN/A

        \[\leadsto \frac{z - y}{z} \cdot x \]
      22. lower--.f6488.4

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{z - y}{z}} \]
      5. div-subN/A

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

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

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

        \[\leadsto x \cdot \left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{\color{blue}{y}}{z}\right) \]
      9. fp-cancel-sign-sub-invN/A

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

        \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \frac{y}{z}\right) \cdot x} \]
      11. mul-1-negN/A

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

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

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

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

        \[\leadsto x - \frac{y}{z} \cdot \color{blue}{x} \]
      16. lower-/.f6488.4

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

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

Alternative 4: 75.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{t - z} \cdot \left(-x\right)\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{-34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 560000:\\ \;\;\;\;\frac{x}{t - z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ z (- t z)) (- x))))
   (if (<= z -5.4e-34) t_1 (if (<= z 560000.0) (* (/ x (- t z)) y) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = (z / (t - z)) * -x;
	double tmp;
	if (z <= -5.4e-34) {
		tmp = t_1;
	} else if (z <= 560000.0) {
		tmp = (x / (t - z)) * y;
	} else {
		tmp = t_1;
	}
	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 = (z / (t - z)) * -x
    if (z <= (-5.4d-34)) then
        tmp = t_1
    else if (z <= 560000.0d0) then
        tmp = (x / (t - z)) * y
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z / (t - z)) * -x;
	double tmp;
	if (z <= -5.4e-34) {
		tmp = t_1;
	} else if (z <= 560000.0) {
		tmp = (x / (t - z)) * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z / (t - z)) * -x
	tmp = 0
	if z <= -5.4e-34:
		tmp = t_1
	elif z <= 560000.0:
		tmp = (x / (t - z)) * y
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z / Float64(t - z)) * Float64(-x))
	tmp = 0.0
	if (z <= -5.4e-34)
		tmp = t_1;
	elseif (z <= 560000.0)
		tmp = Float64(Float64(x / Float64(t - z)) * y);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z / (t - z)) * -x;
	tmp = 0.0;
	if (z <= -5.4e-34)
		tmp = t_1;
	elseif (z <= 560000.0)
		tmp = (x / (t - z)) * y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]}, If[LessEqual[z, -5.4e-34], t$95$1, If[LessEqual[z, 560000.0], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z}{t - z} \cdot \left(-x\right)\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 560000:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.40000000000000034e-34 or 5.6e5 < z

    1. Initial program 75.3%

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

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

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

        \[\leadsto \mathsf{neg}\left(x \cdot \frac{z}{t - z}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\frac{z}{t - z} \cdot x\right) \]
      4. distribute-rgt-neg-inN/A

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

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

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

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

        \[\leadsto \frac{z}{t - z} \cdot \left(-1 \cdot x\right) \]
      9. mul-1-negN/A

        \[\leadsto \frac{z}{t - z} \cdot \left(\mathsf{neg}\left(x\right)\right) \]
      10. lower-neg.f6474.8

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

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

    if -5.40000000000000034e-34 < z < 5.6e5

    1. Initial program 93.0%

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
      6. div-subN/A

        \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)} \]
      7. distribute-lft-out--N/A

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{t - z} - \color{blue}{z \cdot \frac{x}{t - z}} \]
      14. distribute-rgt-out--N/A

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

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

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

        \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot \left(y - z\right) \]
      18. lift--.f6493.4

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

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

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

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

    Alternative 5: 75.3% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{z - y}{z} \cdot x\\ \mathbf{elif}\;z \leq 11000:\\ \;\;\;\;\frac{x}{t - z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z} \cdot x\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -3.65e-6)
       (* (/ (- z y) z) x)
       (if (<= z 11000.0) (* (/ x (- t z)) y) (- x (* (/ y z) x)))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -3.65e-6) {
    		tmp = ((z - y) / z) * x;
    	} else if (z <= 11000.0) {
    		tmp = (x / (t - z)) * y;
    	} else {
    		tmp = x - ((y / z) * x);
    	}
    	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 (z <= (-3.65d-6)) then
            tmp = ((z - y) / z) * x
        else if (z <= 11000.0d0) then
            tmp = (x / (t - z)) * y
        else
            tmp = x - ((y / z) * x)
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -3.65e-6) {
    		tmp = ((z - y) / z) * x;
    	} else if (z <= 11000.0) {
    		tmp = (x / (t - z)) * y;
    	} else {
    		tmp = x - ((y / z) * x);
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if z <= -3.65e-6:
    		tmp = ((z - y) / z) * x
    	elif z <= 11000.0:
    		tmp = (x / (t - z)) * y
    	else:
    		tmp = x - ((y / z) * x)
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -3.65e-6)
    		tmp = Float64(Float64(Float64(z - y) / z) * x);
    	elseif (z <= 11000.0)
    		tmp = Float64(Float64(x / Float64(t - z)) * y);
    	else
    		tmp = Float64(x - Float64(Float64(y / z) * x));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (z <= -3.65e-6)
    		tmp = ((z - y) / z) * x;
    	elseif (z <= 11000.0)
    		tmp = (x / (t - z)) * y;
    	else
    		tmp = x - ((y / z) * x);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -3.65e-6], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 11000.0], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -3.65 \cdot 10^{-6}:\\
    \;\;\;\;\frac{z - y}{z} \cdot x\\
    
    \mathbf{elif}\;z \leq 11000:\\
    \;\;\;\;\frac{x}{t - z} \cdot y\\
    
    \mathbf{else}:\\
    \;\;\;\;x - \frac{y}{z} \cdot x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -3.65000000000000021e-6

      1. Initial program 74.4%

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

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

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

          \[\leadsto \mathsf{neg}\left(x \cdot \frac{y - z}{z}\right) \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{neg}\left(\frac{y - z}{z} \cdot x\right) \]
        4. distribute-lft-neg-outN/A

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

          \[\leadsto \left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot \color{blue}{x} \]
        6. distribute-neg-fracN/A

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

          \[\leadsto \frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z} \cdot x \]
        8. *-lft-identityN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(y - 1 \cdot z\right)\right)}{z} \cdot x \]
        9. cancel-sign-sub-invN/A

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

          \[\leadsto \frac{\mathsf{neg}\left(\left(y + -1 \cdot z\right)\right)}{z} \cdot x \]
        11. mul-1-negN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)\right)}{z} \cdot x \]
        12. +-commutativeN/A

          \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)\right)}{z} \cdot x \]
        13. distribute-neg-inN/A

          \[\leadsto \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
        14. mul-1-negN/A

          \[\leadsto \frac{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
        15. distribute-lft-neg-outN/A

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

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

          \[\leadsto \frac{z + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
        18. mul-1-negN/A

          \[\leadsto \frac{z + -1 \cdot y}{z} \cdot x \]
        19. metadata-evalN/A

          \[\leadsto \frac{z + \left(\mathsf{neg}\left(1\right)\right) \cdot y}{z} \cdot x \]
        20. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{z - 1 \cdot y}{z} \cdot x \]
        21. *-lft-identityN/A

          \[\leadsto \frac{z - y}{z} \cdot x \]
        22. lower--.f6474.4

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

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

      if -3.65000000000000021e-6 < z < 11000

      1. Initial program 93.0%

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

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

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

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

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

          \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
        6. div-subN/A

          \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)} \]
        7. distribute-lft-out--N/A

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

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

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

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

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

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

          \[\leadsto y \cdot \frac{x}{t - z} - \color{blue}{z \cdot \frac{x}{t - z}} \]
        14. distribute-rgt-out--N/A

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

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

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

          \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot \left(y - z\right) \]
        18. lift--.f6493.4

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

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

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

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

        if 11000 < z

        1. Initial program 74.6%

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

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

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

            \[\leadsto \mathsf{neg}\left(x \cdot \frac{y - z}{z}\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(\frac{y - z}{z} \cdot x\right) \]
          4. distribute-lft-neg-outN/A

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

            \[\leadsto \left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot \color{blue}{x} \]
          6. distribute-neg-fracN/A

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

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z} \cdot x \]
          8. *-lft-identityN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - 1 \cdot z\right)\right)}{z} \cdot x \]
          9. cancel-sign-sub-invN/A

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

            \[\leadsto \frac{\mathsf{neg}\left(\left(y + -1 \cdot z\right)\right)}{z} \cdot x \]
          11. mul-1-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)\right)}{z} \cdot x \]
          12. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)\right)}{z} \cdot x \]
          13. distribute-neg-inN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          14. mul-1-negN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          15. distribute-lft-neg-outN/A

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

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

            \[\leadsto \frac{z + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          18. mul-1-negN/A

            \[\leadsto \frac{z + -1 \cdot y}{z} \cdot x \]
          19. metadata-evalN/A

            \[\leadsto \frac{z + \left(\mathsf{neg}\left(1\right)\right) \cdot y}{z} \cdot x \]
          20. fp-cancel-sub-sign-invN/A

            \[\leadsto \frac{z - 1 \cdot y}{z} \cdot x \]
          21. *-lft-identityN/A

            \[\leadsto \frac{z - y}{z} \cdot x \]
          22. lower--.f6475.0

            \[\leadsto \frac{z - y}{z} \cdot x \]
        4. Applied rewrites75.0%

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

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

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

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

            \[\leadsto x \cdot \color{blue}{\frac{z - y}{z}} \]
          5. div-subN/A

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

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

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

            \[\leadsto x \cdot \left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{\color{blue}{y}}{z}\right) \]
          9. fp-cancel-sign-sub-invN/A

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

            \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \frac{y}{z}\right) \cdot x} \]
          11. mul-1-negN/A

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

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

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

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

            \[\leadsto x - \frac{y}{z} \cdot \color{blue}{x} \]
          16. lower-/.f6475.0

            \[\leadsto x - \frac{y}{z} \cdot x \]
        6. Applied rewrites75.0%

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

      Alternative 6: 74.2% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - z}{t} \cdot x\\ \mathbf{if}\;t \leq -2.2 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+47}:\\ \;\;\;\;x - \frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (/ (- y z) t) x)))
         (if (<= t -2.2e-28) t_1 (if (<= t 1.25e+47) (- x (* (/ y z) x)) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = ((y - z) / t) * x;
      	double tmp;
      	if (t <= -2.2e-28) {
      		tmp = t_1;
      	} else if (t <= 1.25e+47) {
      		tmp = x - ((y / z) * x);
      	} else {
      		tmp = t_1;
      	}
      	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 = ((y - z) / t) * x
          if (t <= (-2.2d-28)) then
              tmp = t_1
          else if (t <= 1.25d+47) then
              tmp = x - ((y / z) * x)
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = ((y - z) / t) * x;
      	double tmp;
      	if (t <= -2.2e-28) {
      		tmp = t_1;
      	} else if (t <= 1.25e+47) {
      		tmp = x - ((y / z) * x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = ((y - z) / t) * x
      	tmp = 0
      	if t <= -2.2e-28:
      		tmp = t_1
      	elif t <= 1.25e+47:
      		tmp = x - ((y / z) * x)
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(Float64(y - z) / t) * x)
      	tmp = 0.0
      	if (t <= -2.2e-28)
      		tmp = t_1;
      	elseif (t <= 1.25e+47)
      		tmp = Float64(x - Float64(Float64(y / z) * x));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = ((y - z) / t) * x;
      	tmp = 0.0;
      	if (t <= -2.2e-28)
      		tmp = t_1;
      	elseif (t <= 1.25e+47)
      		tmp = x - ((y / z) * x);
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -2.2e-28], t$95$1, If[LessEqual[t, 1.25e+47], N[(x - N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{y - z}{t} \cdot x\\
      \mathbf{if}\;t \leq -2.2 \cdot 10^{-28}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 1.25 \cdot 10^{+47}:\\
      \;\;\;\;x - \frac{y}{z} \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -2.19999999999999996e-28 or 1.25000000000000005e47 < t

        1. Initial program 82.9%

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

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

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

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

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

            \[\leadsto \frac{y - z}{t} \cdot x \]
          5. lift--.f6473.8

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

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

        if -2.19999999999999996e-28 < t < 1.25000000000000005e47

        1. Initial program 84.9%

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

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

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

            \[\leadsto \mathsf{neg}\left(x \cdot \frac{y - z}{z}\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(\frac{y - z}{z} \cdot x\right) \]
          4. distribute-lft-neg-outN/A

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

            \[\leadsto \left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot \color{blue}{x} \]
          6. distribute-neg-fracN/A

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

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z} \cdot x \]
          8. *-lft-identityN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - 1 \cdot z\right)\right)}{z} \cdot x \]
          9. cancel-sign-sub-invN/A

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

            \[\leadsto \frac{\mathsf{neg}\left(\left(y + -1 \cdot z\right)\right)}{z} \cdot x \]
          11. mul-1-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)\right)}{z} \cdot x \]
          12. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)\right)}{z} \cdot x \]
          13. distribute-neg-inN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          14. mul-1-negN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          15. distribute-lft-neg-outN/A

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

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

            \[\leadsto \frac{z + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          18. mul-1-negN/A

            \[\leadsto \frac{z + -1 \cdot y}{z} \cdot x \]
          19. metadata-evalN/A

            \[\leadsto \frac{z + \left(\mathsf{neg}\left(1\right)\right) \cdot y}{z} \cdot x \]
          20. fp-cancel-sub-sign-invN/A

            \[\leadsto \frac{z - 1 \cdot y}{z} \cdot x \]
          21. *-lft-identityN/A

            \[\leadsto \frac{z - y}{z} \cdot x \]
          22. lower--.f6474.6

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

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

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

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

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

            \[\leadsto x \cdot \color{blue}{\frac{z - y}{z}} \]
          5. div-subN/A

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

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

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

            \[\leadsto x \cdot \left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{\color{blue}{y}}{z}\right) \]
          9. fp-cancel-sign-sub-invN/A

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

            \[\leadsto 1 \cdot x + \color{blue}{\left(-1 \cdot \frac{y}{z}\right) \cdot x} \]
          11. mul-1-negN/A

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

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

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

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

            \[\leadsto x - \frac{y}{z} \cdot \color{blue}{x} \]
          16. lower-/.f6474.6

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

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

      Alternative 7: 74.2% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y - z}{t} \cdot x\\ \mathbf{if}\;t \leq -2.2 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+47}:\\ \;\;\;\;\frac{z - y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (/ (- y z) t) x)))
         (if (<= t -2.2e-28) t_1 (if (<= t 1.25e+47) (* (/ (- z y) z) x) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = ((y - z) / t) * x;
      	double tmp;
      	if (t <= -2.2e-28) {
      		tmp = t_1;
      	} else if (t <= 1.25e+47) {
      		tmp = ((z - y) / z) * x;
      	} else {
      		tmp = t_1;
      	}
      	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 = ((y - z) / t) * x
          if (t <= (-2.2d-28)) then
              tmp = t_1
          else if (t <= 1.25d+47) then
              tmp = ((z - y) / z) * x
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = ((y - z) / t) * x;
      	double tmp;
      	if (t <= -2.2e-28) {
      		tmp = t_1;
      	} else if (t <= 1.25e+47) {
      		tmp = ((z - y) / z) * x;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = ((y - z) / t) * x
      	tmp = 0
      	if t <= -2.2e-28:
      		tmp = t_1
      	elif t <= 1.25e+47:
      		tmp = ((z - y) / z) * x
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(Float64(y - z) / t) * x)
      	tmp = 0.0
      	if (t <= -2.2e-28)
      		tmp = t_1;
      	elseif (t <= 1.25e+47)
      		tmp = Float64(Float64(Float64(z - y) / z) * x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = ((y - z) / t) * x;
      	tmp = 0.0;
      	if (t <= -2.2e-28)
      		tmp = t_1;
      	elseif (t <= 1.25e+47)
      		tmp = ((z - y) / z) * x;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -2.2e-28], t$95$1, If[LessEqual[t, 1.25e+47], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{y - z}{t} \cdot x\\
      \mathbf{if}\;t \leq -2.2 \cdot 10^{-28}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 1.25 \cdot 10^{+47}:\\
      \;\;\;\;\frac{z - y}{z} \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -2.19999999999999996e-28 or 1.25000000000000005e47 < t

        1. Initial program 82.9%

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

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

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

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

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

            \[\leadsto \frac{y - z}{t} \cdot x \]
          5. lift--.f6473.8

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

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

        if -2.19999999999999996e-28 < t < 1.25000000000000005e47

        1. Initial program 84.9%

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

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

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

            \[\leadsto \mathsf{neg}\left(x \cdot \frac{y - z}{z}\right) \]
          3. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(\frac{y - z}{z} \cdot x\right) \]
          4. distribute-lft-neg-outN/A

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

            \[\leadsto \left(\mathsf{neg}\left(\frac{y - z}{z}\right)\right) \cdot \color{blue}{x} \]
          6. distribute-neg-fracN/A

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

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - z\right)\right)}{z} \cdot x \]
          8. *-lft-identityN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y - 1 \cdot z\right)\right)}{z} \cdot x \]
          9. cancel-sign-sub-invN/A

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

            \[\leadsto \frac{\mathsf{neg}\left(\left(y + -1 \cdot z\right)\right)}{z} \cdot x \]
          11. mul-1-negN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)\right)}{z} \cdot x \]
          12. +-commutativeN/A

            \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)\right)}{z} \cdot x \]
          13. distribute-neg-inN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          14. mul-1-negN/A

            \[\leadsto \frac{\left(\mathsf{neg}\left(-1 \cdot z\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          15. distribute-lft-neg-outN/A

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

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

            \[\leadsto \frac{z + \left(\mathsf{neg}\left(y\right)\right)}{z} \cdot x \]
          18. mul-1-negN/A

            \[\leadsto \frac{z + -1 \cdot y}{z} \cdot x \]
          19. metadata-evalN/A

            \[\leadsto \frac{z + \left(\mathsf{neg}\left(1\right)\right) \cdot y}{z} \cdot x \]
          20. fp-cancel-sub-sign-invN/A

            \[\leadsto \frac{z - 1 \cdot y}{z} \cdot x \]
          21. *-lft-identityN/A

            \[\leadsto \frac{z - y}{z} \cdot x \]
          22. lower--.f6474.6

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

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

      Alternative 8: 67.8% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+88}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 29500000:\\ \;\;\;\;\frac{y - z}{t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= z -6.6e+88) x (if (<= z 29500000.0) (* (/ (- y z) t) x) x)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (z <= -6.6e+88) {
      		tmp = x;
      	} else if (z <= 29500000.0) {
      		tmp = ((y - z) / t) * x;
      	} else {
      		tmp = x;
      	}
      	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 (z <= (-6.6d+88)) then
              tmp = x
          else if (z <= 29500000.0d0) then
              tmp = ((y - z) / t) * x
          else
              tmp = x
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double t) {
      	double tmp;
      	if (z <= -6.6e+88) {
      		tmp = x;
      	} else if (z <= 29500000.0) {
      		tmp = ((y - z) / t) * x;
      	} else {
      		tmp = x;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	tmp = 0
      	if z <= -6.6e+88:
      		tmp = x
      	elif z <= 29500000.0:
      		tmp = ((y - z) / t) * x
      	else:
      		tmp = x
      	return tmp
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (z <= -6.6e+88)
      		tmp = x;
      	elseif (z <= 29500000.0)
      		tmp = Float64(Float64(Float64(y - z) / t) * x);
      	else
      		tmp = x;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	tmp = 0.0;
      	if (z <= -6.6e+88)
      		tmp = x;
      	elseif (z <= 29500000.0)
      		tmp = ((y - z) / t) * x;
      	else
      		tmp = x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[z, -6.6e+88], x, If[LessEqual[z, 29500000.0], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision], x]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -6.6 \cdot 10^{+88}:\\
      \;\;\;\;x\\
      
      \mathbf{elif}\;z \leq 29500000:\\
      \;\;\;\;\frac{y - z}{t} \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -6.6000000000000006e88 or 2.95e7 < z

        1. Initial program 71.2%

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

          \[\leadsto \color{blue}{x} \]
        3. Step-by-step derivation
          1. Applied rewrites63.5%

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

          if -6.6000000000000006e88 < z < 2.95e7

          1. Initial program 92.9%

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

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

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

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

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

              \[\leadsto \frac{y - z}{t} \cdot x \]
            5. lift--.f6470.9

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

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

        Alternative 9: 62.1% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+19}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 44000:\\ \;\;\;\;\frac{y}{t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= z -1.7e+19) x (if (<= z 44000.0) (* (/ y t) x) x)))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= -1.7e+19) {
        		tmp = x;
        	} else if (z <= 44000.0) {
        		tmp = (y / t) * x;
        	} else {
        		tmp = x;
        	}
        	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 (z <= (-1.7d+19)) then
                tmp = x
            else if (z <= 44000.0d0) then
                tmp = (y / t) * x
            else
                tmp = x
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= -1.7e+19) {
        		tmp = x;
        	} else if (z <= 44000.0) {
        		tmp = (y / t) * x;
        	} else {
        		tmp = x;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	tmp = 0
        	if z <= -1.7e+19:
        		tmp = x
        	elif z <= 44000.0:
        		tmp = (y / t) * x
        	else:
        		tmp = x
        	return tmp
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (z <= -1.7e+19)
        		tmp = x;
        	elseif (z <= 44000.0)
        		tmp = Float64(Float64(y / t) * x);
        	else
        		tmp = x;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if (z <= -1.7e+19)
        		tmp = x;
        	elseif (z <= 44000.0)
        		tmp = (y / t) * x;
        	else
        		tmp = x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e+19], x, If[LessEqual[z, 44000.0], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], x]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -1.7 \cdot 10^{+19}:\\
        \;\;\;\;x\\
        
        \mathbf{elif}\;z \leq 44000:\\
        \;\;\;\;\frac{y}{t} \cdot x\\
        
        \mathbf{else}:\\
        \;\;\;\;x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -1.7e19 or 44000 < z

          1. Initial program 73.5%

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

            \[\leadsto \color{blue}{x} \]
          3. Step-by-step derivation
            1. Applied rewrites60.0%

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

            if -1.7e19 < z < 44000

            1. Initial program 93.1%

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

              \[\leadsto \color{blue}{\frac{x \cdot y}{t}} \]
            3. Step-by-step derivation
              1. associate-/l*N/A

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

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

                \[\leadsto \frac{y}{t} \cdot \color{blue}{x} \]
              4. lower-/.f6463.9

                \[\leadsto \frac{y}{t} \cdot x \]
            4. Applied rewrites63.9%

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

          Alternative 10: 60.9% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -125:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 40000:\\ \;\;\;\;y \cdot \frac{x}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= z -125.0) x (if (<= z 40000.0) (* y (/ x t)) x)))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (z <= -125.0) {
          		tmp = x;
          	} else if (z <= 40000.0) {
          		tmp = y * (x / t);
          	} else {
          		tmp = x;
          	}
          	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 (z <= (-125.0d0)) then
                  tmp = x
              else if (z <= 40000.0d0) then
                  tmp = y * (x / t)
              else
                  tmp = x
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (z <= -125.0) {
          		tmp = x;
          	} else if (z <= 40000.0) {
          		tmp = y * (x / t);
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if z <= -125.0:
          		tmp = x
          	elif z <= 40000.0:
          		tmp = y * (x / t)
          	else:
          		tmp = x
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (z <= -125.0)
          		tmp = x;
          	elseif (z <= 40000.0)
          		tmp = Float64(y * Float64(x / t));
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (z <= -125.0)
          		tmp = x;
          	elseif (z <= 40000.0)
          		tmp = y * (x / t);
          	else
          		tmp = x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[z, -125.0], x, If[LessEqual[z, 40000.0], N[(y * N[(x / t), $MachinePrecision]), $MachinePrecision], x]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;z \leq -125:\\
          \;\;\;\;x\\
          
          \mathbf{elif}\;z \leq 40000:\\
          \;\;\;\;y \cdot \frac{x}{t}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -125 or 4e4 < z

            1. Initial program 74.2%

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

              \[\leadsto \color{blue}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites59.0%

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

              if -125 < z < 4e4

              1. Initial program 93.1%

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

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

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

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

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

                  \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
                6. div-subN/A

                  \[\leadsto x \cdot \color{blue}{\left(\frac{y}{t - z} - \frac{z}{t - z}\right)} \]
                7. distribute-lft-out--N/A

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

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

                  \[\leadsto \frac{x \cdot y}{t - z} - \color{blue}{\frac{x \cdot z}{t - z}} \]
                10. div-subN/A

                  \[\leadsto \color{blue}{\frac{x \cdot y - x \cdot z}{t - z}} \]
                11. fp-cancel-sub-signN/A

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

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

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

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

                  \[\leadsto \frac{-1 \cdot \left(x \cdot z\right) + \color{blue}{y \cdot x}}{t - z} \]
                16. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                  \[\leadsto \frac{y \cdot x}{t} \]
                3. lower-*.f6462.5

                  \[\leadsto \frac{y \cdot x}{t} \]
              6. Applied rewrites62.5%

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

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

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

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

                  \[\leadsto y \cdot \color{blue}{\frac{x}{t}} \]
                5. lower-/.f6462.8

                  \[\leadsto y \cdot \frac{x}{\color{blue}{t}} \]
              8. Applied rewrites62.8%

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

            Alternative 11: 34.8% accurate, 12.6× speedup?

            \[\begin{array}{l} \\ x \end{array} \]
            (FPCore (x y z t) :precision binary64 x)
            double code(double x, double y, double z, double t) {
            	return x;
            }
            
            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
            end function
            
            public static double code(double x, double y, double z, double t) {
            	return x;
            }
            
            def code(x, y, z, t):
            	return x
            
            function code(x, y, z, t)
            	return x
            end
            
            function tmp = code(x, y, z, t)
            	tmp = x;
            end
            
            code[x_, y_, z_, t_] := x
            
            \begin{array}{l}
            
            \\
            x
            \end{array}
            
            Derivation
            1. Initial program 83.9%

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

              \[\leadsto \color{blue}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites34.8%

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

              Reproduce

              ?
              herbie shell --seed 2025130 
              (FPCore (x y z t)
                :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
                :precision binary64
                (/ (* x (- y z)) (- t z)))