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

Percentage Accurate: 84.9% → 97.0%
Time: 9.6s
Alternatives: 12
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}

Sampling outcomes in binary64 precision:

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

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

Initial Program: 84.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{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: 97.0% 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 87.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
    6. lower-/.f6497.2

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

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

Alternative 2: 89.4% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{z}} \cdot \left(y - t\right) \]
      17. lower--.f6494.9

        \[\leadsto x - \frac{x}{z} \cdot \color{blue}{\left(y - t\right)} \]
    5. Applied rewrites94.9%

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

    if -2.49999999999999997e203 < z < 1.15e90

    1. Initial program 89.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      7. lower-/.f6494.3

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

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

    if 1.15e90 < z

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
      19. lower--.f6492.8

        \[\leadsto \frac{\color{blue}{z - y}}{z} \cdot x \]
    5. Applied rewrites92.8%

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

Alternative 3: 75.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-21} \lor \neg \left(z \leq 6.7 \cdot 10^{-9}\right):\\ \;\;\;\;\frac{z - y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z} \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -7e-21) (not (<= z 6.7e-9)))
   (* (/ (- z y) z) x)
   (* (/ x (- t z)) y)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7e-21) || !(z <= 6.7e-9)) {
		tmp = ((z - y) / z) * x;
	} else {
		tmp = (x / (t - z)) * y;
	}
	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 <= (-7d-21)) .or. (.not. (z <= 6.7d-9))) then
        tmp = ((z - y) / z) * x
    else
        tmp = (x / (t - z)) * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7e-21) || !(z <= 6.7e-9)) {
		tmp = ((z - y) / z) * x;
	} else {
		tmp = (x / (t - z)) * y;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -7e-21) or not (z <= 6.7e-9):
		tmp = ((z - y) / z) * x
	else:
		tmp = (x / (t - z)) * y
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -7e-21) || !(z <= 6.7e-9))
		tmp = Float64(Float64(Float64(z - y) / z) * x);
	else
		tmp = Float64(Float64(x / Float64(t - z)) * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -7e-21) || ~((z <= 6.7e-9)))
		tmp = ((z - y) / z) * x;
	else
		tmp = (x / (t - z)) * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7e-21], N[Not[LessEqual[z, 6.7e-9]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-21} \lor \neg \left(z \leq 6.7 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{z - y}{z} \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.0000000000000007e-21 or 6.69999999999999961e-9 < z

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
      19. lower--.f6481.4

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

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

    if -7.0000000000000007e-21 < z < 6.69999999999999961e-9

    1. Initial program 94.3%

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot y \]
    5. Applied rewrites81.7%

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{-21} \lor \neg \left(z \leq 6.7 \cdot 10^{-9}\right):\\ \;\;\;\;\frac{z - y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t - z} \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-21}:\\
\;\;\;\;x - \frac{x}{z} \cdot \left(y - t\right)\\

\mathbf{elif}\;z \leq 6.7 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.0000000000000007e-21

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{z}} \cdot \left(y - t\right) \]
      17. lower--.f6483.6

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

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

    if -7.0000000000000007e-21 < z < 6.69999999999999961e-9

    1. Initial program 94.3%

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot y \]
    5. Applied rewrites81.7%

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

    if 6.69999999999999961e-9 < z

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
      19. lower--.f6480.4

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

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

Alternative 5: 75.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-21}:\\
\;\;\;\;x - \frac{x}{z} \cdot y\\

\mathbf{elif}\;z \leq 6.7 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{t - z} \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.0000000000000007e-21

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{x}{z}} \cdot \left(y - t\right) \]
      17. lower--.f6483.6

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

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

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

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

      if -7.0000000000000007e-21 < z < 6.69999999999999961e-9

      1. Initial program 94.3%

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

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

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

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

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

          \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot y \]
      5. Applied rewrites81.7%

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

      if 6.69999999999999961e-9 < z

      1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{z - \color{blue}{y}}{z} \cdot x \]
        19. lower--.f6480.4

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

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

    Alternative 6: 68.1% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+32}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, t, x\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+114}:\\ \;\;\;\;\frac{x}{t - z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -3.1e+32)
       (fma (/ x z) t x)
       (if (<= z 2.3e+114) (* (/ x (- t z)) y) (* 1.0 x))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -3.1e+32) {
    		tmp = fma((x / z), t, x);
    	} else if (z <= 2.3e+114) {
    		tmp = (x / (t - z)) * y;
    	} else {
    		tmp = 1.0 * x;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -3.1e+32)
    		tmp = fma(Float64(x / z), t, x);
    	elseif (z <= 2.3e+114)
    		tmp = Float64(Float64(x / Float64(t - z)) * y);
    	else
    		tmp = Float64(1.0 * x);
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -3.1e+32], N[(N[(x / z), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 2.3e+114], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -3.1 \cdot 10^{+32}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, t, x\right)\\
    
    \mathbf{elif}\;z \leq 2.3 \cdot 10^{+114}:\\
    \;\;\;\;\frac{x}{t - z} \cdot y\\
    
    \mathbf{else}:\\
    \;\;\;\;1 \cdot x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -3.09999999999999993e32

      1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x - \color{blue}{\frac{x}{z}} \cdot \left(y - t\right) \]
        17. lower--.f6483.6

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

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

        \[\leadsto x - \color{blue}{-1 \cdot \frac{t \cdot x}{z}} \]
      7. Step-by-step derivation
        1. Applied rewrites68.0%

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

        if -3.09999999999999993e32 < z < 2.3e114

        1. Initial program 94.6%

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

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

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

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

            \[\leadsto \color{blue}{\frac{x}{t - z}} \cdot y \]
          4. lower--.f6473.6

            \[\leadsto \frac{x}{\color{blue}{t - z}} \cdot y \]
        5. Applied rewrites73.6%

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

        if 2.3e114 < z

        1. Initial program 72.9%

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
          6. lower-/.f6499.9

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

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

          \[\leadsto \color{blue}{1} \cdot x \]
        6. Step-by-step derivation
          1. Applied rewrites86.4%

            \[\leadsto \color{blue}{1} \cdot x \]
        7. Recombined 3 regimes into one program.
        8. Add Preprocessing

        Alternative 7: 65.9% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-21}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, t, x\right)\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{t} \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= z -8.2e-21)
           (fma (/ x z) t x)
           (if (<= z 2.05e-6) (* (/ x t) (- y z)) (* 1.0 x))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (z <= -8.2e-21) {
        		tmp = fma((x / z), t, x);
        	} else if (z <= 2.05e-6) {
        		tmp = (x / t) * (y - z);
        	} else {
        		tmp = 1.0 * x;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (z <= -8.2e-21)
        		tmp = fma(Float64(x / z), t, x);
        	elseif (z <= 2.05e-6)
        		tmp = Float64(Float64(x / t) * Float64(y - z));
        	else
        		tmp = Float64(1.0 * x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[z, -8.2e-21], N[(N[(x / z), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 2.05e-6], N[(N[(x / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -8.2 \cdot 10^{-21}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, t, x\right)\\
        
        \mathbf{elif}\;z \leq 2.05 \cdot 10^{-6}:\\
        \;\;\;\;\frac{x}{t} \cdot \left(y - z\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;1 \cdot x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -8.19999999999999988e-21

          1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x - \color{blue}{\frac{x}{z}} \cdot \left(y - t\right) \]
            17. lower--.f6483.6

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

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

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

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

            if -8.19999999999999988e-21 < z < 2.0499999999999999e-6

            1. Initial program 94.3%

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{y - z}{t}} \cdot x \]
              5. lower--.f6478.6

                \[\leadsto \frac{\color{blue}{y - z}}{t} \cdot x \]
            5. Applied rewrites78.6%

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

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

              if 2.0499999999999999e-6 < z

              1. Initial program 84.9%

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                6. lower-/.f6499.9

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

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

                \[\leadsto \color{blue}{1} \cdot x \]
              6. Step-by-step derivation
                1. Applied rewrites60.8%

                  \[\leadsto \color{blue}{1} \cdot x \]
              7. Recombined 3 regimes into one program.
              8. Add Preprocessing

              Alternative 8: 61.9% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.04 \cdot 10^{-19} \lor \neg \left(z \leq 85000000000\right):\\ \;\;\;\;1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t} \cdot x\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= z -1.04e-19) (not (<= z 85000000000.0))) (* 1.0 x) (* (/ y t) x)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((z <= -1.04e-19) || !(z <= 85000000000.0)) {
              		tmp = 1.0 * x;
              	} else {
              		tmp = (y / t) * 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.04d-19)) .or. (.not. (z <= 85000000000.0d0))) then
                      tmp = 1.0d0 * x
                  else
                      tmp = (y / t) * x
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((z <= -1.04e-19) || !(z <= 85000000000.0)) {
              		tmp = 1.0 * x;
              	} else {
              		tmp = (y / t) * x;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	tmp = 0
              	if (z <= -1.04e-19) or not (z <= 85000000000.0):
              		tmp = 1.0 * x
              	else:
              		tmp = (y / t) * x
              	return tmp
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((z <= -1.04e-19) || !(z <= 85000000000.0))
              		tmp = Float64(1.0 * x);
              	else
              		tmp = Float64(Float64(y / t) * x);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	tmp = 0.0;
              	if ((z <= -1.04e-19) || ~((z <= 85000000000.0)))
              		tmp = 1.0 * x;
              	else
              		tmp = (y / t) * x;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.04e-19], N[Not[LessEqual[z, 85000000000.0]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -1.04 \cdot 10^{-19} \lor \neg \left(z \leq 85000000000\right):\\
              \;\;\;\;1 \cdot x\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{y}{t} \cdot x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -1.03999999999999998e-19 or 8.5e10 < z

                1. Initial program 79.9%

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{1} \cdot x \]
                6. Step-by-step derivation
                  1. Applied rewrites62.3%

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

                  if -1.03999999999999998e-19 < z < 8.5e10

                  1. Initial program 94.5%

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

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

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

                      \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                    3. lower-*.f6468.2

                      \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                  5. Applied rewrites68.2%

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

                      \[\leadsto \frac{y}{t} \cdot \color{blue}{x} \]
                  7. Recombined 2 regimes into one program.
                  8. Final simplification65.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.04 \cdot 10^{-19} \lor \neg \left(z \leq 85000000000\right):\\ \;\;\;\;1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t} \cdot x\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 9: 61.1% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.04 \cdot 10^{-19} \lor \neg \left(z \leq 6.7 \cdot 10^{-9}\right):\\ \;\;\;\;1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t} \cdot y\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (or (<= z -1.04e-19) (not (<= z 6.7e-9))) (* 1.0 x) (* (/ x t) y)))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z <= -1.04e-19) || !(z <= 6.7e-9)) {
                  		tmp = 1.0 * x;
                  	} else {
                  		tmp = (x / t) * y;
                  	}
                  	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.04d-19)) .or. (.not. (z <= 6.7d-9))) then
                          tmp = 1.0d0 * x
                      else
                          tmp = (x / t) * y
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z <= -1.04e-19) || !(z <= 6.7e-9)) {
                  		tmp = 1.0 * x;
                  	} else {
                  		tmp = (x / t) * y;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if (z <= -1.04e-19) or not (z <= 6.7e-9):
                  		tmp = 1.0 * x
                  	else:
                  		tmp = (x / t) * y
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if ((z <= -1.04e-19) || !(z <= 6.7e-9))
                  		tmp = Float64(1.0 * x);
                  	else
                  		tmp = Float64(Float64(x / t) * y);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if ((z <= -1.04e-19) || ~((z <= 6.7e-9)))
                  		tmp = 1.0 * x;
                  	else
                  		tmp = (x / t) * y;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.04e-19], N[Not[LessEqual[z, 6.7e-9]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -1.04 \cdot 10^{-19} \lor \neg \left(z \leq 6.7 \cdot 10^{-9}\right):\\
                  \;\;\;\;1 \cdot x\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{x}{t} \cdot y\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -1.03999999999999998e-19 or 6.69999999999999961e-9 < z

                    1. Initial program 80.7%

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{1} \cdot x \]
                    6. Step-by-step derivation
                      1. Applied rewrites60.7%

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

                      if -1.03999999999999998e-19 < z < 6.69999999999999961e-9

                      1. Initial program 94.3%

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

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

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

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

                          \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                      5. Applied rewrites69.9%

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

                          \[\leadsto \frac{x}{t} \cdot \color{blue}{y} \]
                      7. Recombined 2 regimes into one program.
                      8. Final simplification65.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.04 \cdot 10^{-19} \lor \neg \left(z \leq 6.7 \cdot 10^{-9}\right):\\ \;\;\;\;1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t} \cdot y\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 10: 61.8% accurate, 0.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.04 \cdot 10^{-19}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, t, x\right)\\ \mathbf{elif}\;z \leq 85000000000:\\ \;\;\;\;\frac{y}{t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (if (<= z -1.04e-19)
                         (fma (/ x z) t x)
                         (if (<= z 85000000000.0) (* (/ y t) x) (* 1.0 x))))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (z <= -1.04e-19) {
                      		tmp = fma((x / z), t, x);
                      	} else if (z <= 85000000000.0) {
                      		tmp = (y / t) * x;
                      	} else {
                      		tmp = 1.0 * x;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if (z <= -1.04e-19)
                      		tmp = fma(Float64(x / z), t, x);
                      	elseif (z <= 85000000000.0)
                      		tmp = Float64(Float64(y / t) * x);
                      	else
                      		tmp = Float64(1.0 * x);
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_] := If[LessEqual[z, -1.04e-19], N[(N[(x / z), $MachinePrecision] * t + x), $MachinePrecision], If[LessEqual[z, 85000000000.0], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -1.04 \cdot 10^{-19}:\\
                      \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, t, x\right)\\
                      
                      \mathbf{elif}\;z \leq 85000000000:\\
                      \;\;\;\;\frac{y}{t} \cdot x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;1 \cdot x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if z < -1.03999999999999998e-19

                        1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto x - \color{blue}{\frac{x}{z}} \cdot \left(y - t\right) \]
                          17. lower--.f6483.6

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

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

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

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

                          if -1.03999999999999998e-19 < z < 8.5e10

                          1. Initial program 94.5%

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

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

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

                              \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                            3. lower-*.f6468.2

                              \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                          5. Applied rewrites68.2%

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

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

                            if 8.5e10 < z

                            1. Initial program 83.5%

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{1} \cdot x \]
                            6. Step-by-step derivation
                              1. Applied rewrites64.4%

                                \[\leadsto \color{blue}{1} \cdot x \]
                            7. Recombined 3 regimes into one program.
                            8. Add Preprocessing

                            Alternative 11: 61.9% accurate, 0.8× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.04 \cdot 10^{-19}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{z}, x, x\right)\\ \mathbf{elif}\;z \leq 85000000000:\\ \;\;\;\;\frac{y}{t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x\\ \end{array} \end{array} \]
                            (FPCore (x y z t)
                             :precision binary64
                             (if (<= z -1.04e-19)
                               (fma (/ t z) x x)
                               (if (<= z 85000000000.0) (* (/ y t) x) (* 1.0 x))))
                            double code(double x, double y, double z, double t) {
                            	double tmp;
                            	if (z <= -1.04e-19) {
                            		tmp = fma((t / z), x, x);
                            	} else if (z <= 85000000000.0) {
                            		tmp = (y / t) * x;
                            	} else {
                            		tmp = 1.0 * x;
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z, t)
                            	tmp = 0.0
                            	if (z <= -1.04e-19)
                            		tmp = fma(Float64(t / z), x, x);
                            	elseif (z <= 85000000000.0)
                            		tmp = Float64(Float64(y / t) * x);
                            	else
                            		tmp = Float64(1.0 * x);
                            	end
                            	return tmp
                            end
                            
                            code[x_, y_, z_, t_] := If[LessEqual[z, -1.04e-19], N[(N[(t / z), $MachinePrecision] * x + x), $MachinePrecision], If[LessEqual[z, 85000000000.0], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;z \leq -1.04 \cdot 10^{-19}:\\
                            \;\;\;\;\mathsf{fma}\left(\frac{t}{z}, x, x\right)\\
                            
                            \mathbf{elif}\;z \leq 85000000000:\\
                            \;\;\;\;\frac{y}{t} \cdot x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;1 \cdot x\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if z < -1.03999999999999998e-19

                              1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto x - \color{blue}{\frac{x}{z}} \cdot \left(y - t\right) \]
                                17. lower--.f6483.6

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

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

                                \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                              7. Step-by-step derivation
                                1. Applied rewrites3.9%

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

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

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

                                  if -1.03999999999999998e-19 < z < 8.5e10

                                  1. Initial program 94.5%

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

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

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

                                      \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                                    3. lower-*.f6468.2

                                      \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                                  5. Applied rewrites68.2%

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

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

                                    if 8.5e10 < z

                                    1. Initial program 83.5%

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{1} \cdot x \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites64.4%

                                        \[\leadsto \color{blue}{1} \cdot x \]
                                    7. Recombined 3 regimes into one program.
                                    8. Add Preprocessing

                                    Alternative 12: 34.8% accurate, 3.8× speedup?

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                                      6. lower-/.f6497.2

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

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

                                      \[\leadsto \color{blue}{1} \cdot x \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites34.0%

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

                                      Developer Target 1: 97.0% accurate, 0.8× speedup?

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

                                      Reproduce

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