Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 2.9s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

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

\\
x + \left(y - z\right) \cdot \left(t - x\right)
\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 11 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 65.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ t_2 := \left(y - z\right) \cdot t\\ \mathbf{if}\;y \leq -1.75 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{-73}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{-246}:\\ \;\;\;\;\left(1 + z\right) \cdot x\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+31}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- t x) y)) (t_2 (* (- y z) t)))
   (if (<= y -1.75e+64)
     t_1
     (if (<= y -8.2e-73)
       t_2
       (if (<= y 4.4e-246) (* (+ 1.0 z) x) (if (<= y 2.7e+31) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (t - x) * y;
	double t_2 = (y - z) * t;
	double tmp;
	if (y <= -1.75e+64) {
		tmp = t_1;
	} else if (y <= -8.2e-73) {
		tmp = t_2;
	} else if (y <= 4.4e-246) {
		tmp = (1.0 + z) * x;
	} else if (y <= 2.7e+31) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (t - x) * y
    t_2 = (y - z) * t
    if (y <= (-1.75d+64)) then
        tmp = t_1
    else if (y <= (-8.2d-73)) then
        tmp = t_2
    else if (y <= 4.4d-246) then
        tmp = (1.0d0 + z) * x
    else if (y <= 2.7d+31) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (t - x) * y;
	double t_2 = (y - z) * t;
	double tmp;
	if (y <= -1.75e+64) {
		tmp = t_1;
	} else if (y <= -8.2e-73) {
		tmp = t_2;
	} else if (y <= 4.4e-246) {
		tmp = (1.0 + z) * x;
	} else if (y <= 2.7e+31) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (t - x) * y
	t_2 = (y - z) * t
	tmp = 0
	if y <= -1.75e+64:
		tmp = t_1
	elif y <= -8.2e-73:
		tmp = t_2
	elif y <= 4.4e-246:
		tmp = (1.0 + z) * x
	elif y <= 2.7e+31:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(t - x) * y)
	t_2 = Float64(Float64(y - z) * t)
	tmp = 0.0
	if (y <= -1.75e+64)
		tmp = t_1;
	elseif (y <= -8.2e-73)
		tmp = t_2;
	elseif (y <= 4.4e-246)
		tmp = Float64(Float64(1.0 + z) * x);
	elseif (y <= 2.7e+31)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (t - x) * y;
	t_2 = (y - z) * t;
	tmp = 0.0;
	if (y <= -1.75e+64)
		tmp = t_1;
	elseif (y <= -8.2e-73)
		tmp = t_2;
	elseif (y <= 4.4e-246)
		tmp = (1.0 + z) * x;
	elseif (y <= 2.7e+31)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -1.75e+64], t$95$1, If[LessEqual[y, -8.2e-73], t$95$2, If[LessEqual[y, 4.4e-246], N[(N[(1.0 + z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 2.7e+31], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot y\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -8.2 \cdot 10^{-73}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 4.4 \cdot 10^{-246}:\\
\;\;\;\;\left(1 + z\right) \cdot x\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7499999999999999e64 or 2.69999999999999986e31 < y

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left(t - x\right) \cdot \color{blue}{y} \]
      3. lift--.f6485.7

        \[\leadsto \left(t - x\right) \cdot y \]
    5. Applied rewrites85.7%

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

    if -1.7499999999999999e64 < y < -8.20000000000000032e-73 or 4.39999999999999996e-246 < y < 2.69999999999999986e31

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left(y - z\right) \cdot \color{blue}{t} \]
      3. lift--.f6457.6

        \[\leadsto \left(y - z\right) \cdot t \]
    5. Applied rewrites57.6%

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

    if -8.20000000000000032e-73 < y < 4.39999999999999996e-246

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \left(1 - 1 \cdot \left(y - z\right)\right) \cdot x \]
      5. *-lft-identityN/A

        \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
      6. lower--.f64N/A

        \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
      7. lift--.f6465.0

        \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
    5. Applied rewrites65.0%

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

      \[\leadsto \left(1 + z\right) \cdot x \]
    7. Step-by-step derivation
      1. lower-+.f6465.0

        \[\leadsto \left(1 + z\right) \cdot x \]
    8. Applied rewrites65.0%

      \[\leadsto \left(1 + z\right) \cdot x \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 53.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-z\right) \cdot t\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+176}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.12 \cdot 10^{+77}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-58}:\\ \;\;\;\;\mathsf{fma}\left(t, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- z) t)))
   (if (<= z -1.8e+176)
     t_1
     (if (<= z -2.12e+77) (* z x) (if (<= z 3.6e-58) (fma t y x) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = -z * t;
	double tmp;
	if (z <= -1.8e+176) {
		tmp = t_1;
	} else if (z <= -2.12e+77) {
		tmp = z * x;
	} else if (z <= 3.6e-58) {
		tmp = fma(t, y, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(-z) * t)
	tmp = 0.0
	if (z <= -1.8e+176)
		tmp = t_1;
	elseif (z <= -2.12e+77)
		tmp = Float64(z * x);
	elseif (z <= 3.6e-58)
		tmp = fma(t, y, x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-z) * t), $MachinePrecision]}, If[LessEqual[z, -1.8e+176], t$95$1, If[LessEqual[z, -2.12e+77], N[(z * x), $MachinePrecision], If[LessEqual[z, 3.6e-58], N[(t * y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-z\right) \cdot t\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.12 \cdot 10^{+77}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.79999999999999996e176 or 3.60000000000000009e-58 < z

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \left(-z\right) \cdot \left(\color{blue}{t} - x\right) \]
      5. lift--.f6475.3

        \[\leadsto \left(-z\right) \cdot \left(t - \color{blue}{x}\right) \]
    5. Applied rewrites75.3%

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

      \[\leadsto \left(-z\right) \cdot t \]
    7. Step-by-step derivation
      1. Applied rewrites50.2%

        \[\leadsto \left(-z\right) \cdot t \]

      if -1.79999999999999996e176 < z < -2.12000000000000006e77

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto \left(1 - 1 \cdot \left(y - z\right)\right) \cdot x \]
        5. *-lft-identityN/A

          \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
        6. lower--.f64N/A

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

          \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
      5. Applied rewrites66.2%

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

        \[\leadsto z \cdot x \]
      7. Step-by-step derivation
        1. Applied rewrites45.8%

          \[\leadsto z \cdot x \]

        if -2.12000000000000006e77 < z < 3.60000000000000009e-58

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

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

            \[\leadsto \left(t - x\right) \cdot y + x \]
          3. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
          4. lift--.f6489.8

            \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
        5. Applied rewrites89.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
        6. Taylor expanded in x around 0

          \[\leadsto \mathsf{fma}\left(t, y, x\right) \]
        7. Step-by-step derivation
          1. Applied rewrites64.4%

            \[\leadsto \mathsf{fma}\left(t, y, x\right) \]
        8. Recombined 3 regimes into one program.
        9. Add Preprocessing

        Alternative 4: 34.0% accurate, 0.6× speedup?

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

          1. Initial program 100.0%

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

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

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

              \[\leadsto \left(t - x\right) \cdot \color{blue}{y} \]
            3. lift--.f6455.3

              \[\leadsto \left(t - x\right) \cdot y \]
          5. Applied rewrites55.3%

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

            \[\leadsto t \cdot y \]
          7. Step-by-step derivation
            1. Applied rewrites47.2%

              \[\leadsto t \cdot y \]

            if -6.50000000000000012e-36 < t < -1.6e-246

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

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

                \[\leadsto \left(t - x\right) \cdot y + x \]
              3. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
              4. lift--.f6464.0

                \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
            5. Applied rewrites64.0%

              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
            6. Taylor expanded in y around 0

              \[\leadsto x \]
            7. Step-by-step derivation
              1. Applied rewrites35.1%

                \[\leadsto x \]

              if -1.6e-246 < t < 5.5e16

              1. Initial program 100.0%

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

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

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

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

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

                  \[\leadsto \left(1 - 1 \cdot \left(y - z\right)\right) \cdot x \]
                5. *-lft-identityN/A

                  \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                6. lower--.f64N/A

                  \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                7. lift--.f6487.8

                  \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
              5. Applied rewrites87.8%

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

                \[\leadsto z \cdot x \]
              7. Step-by-step derivation
                1. Applied rewrites33.7%

                  \[\leadsto z \cdot x \]
              8. Recombined 3 regimes into one program.
              9. Add Preprocessing

              Alternative 5: 84.1% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+52} \lor \neg \left(z \leq 3.7 \cdot 10^{+50}\right):\\ \;\;\;\;\left(-z\right) \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= z -2.25e+52) (not (<= z 3.7e+50)))
                 (* (- z) (- t x))
                 (fma (- t x) y x)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((z <= -2.25e+52) || !(z <= 3.7e+50)) {
              		tmp = -z * (t - x);
              	} else {
              		tmp = fma((t - x), y, x);
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((z <= -2.25e+52) || !(z <= 3.7e+50))
              		tmp = Float64(Float64(-z) * Float64(t - x));
              	else
              		tmp = fma(Float64(t - x), y, x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.25e+52], N[Not[LessEqual[z, 3.7e+50]], $MachinePrecision]], N[((-z) * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -2.25 \cdot 10^{+52} \lor \neg \left(z \leq 3.7 \cdot 10^{+50}\right):\\
              \;\;\;\;\left(-z\right) \cdot \left(t - x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -2.25e52 or 3.7000000000000001e50 < z

                1. Initial program 100.0%

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

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

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

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

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

                    \[\leadsto \left(-z\right) \cdot \left(\color{blue}{t} - x\right) \]
                  5. lift--.f6478.7

                    \[\leadsto \left(-z\right) \cdot \left(t - \color{blue}{x}\right) \]
                5. Applied rewrites78.7%

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

                if -2.25e52 < z < 3.7000000000000001e50

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

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

                    \[\leadsto \left(t - x\right) \cdot y + x \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
                  4. lift--.f6487.5

                    \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
                5. Applied rewrites87.5%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification83.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{+52} \lor \neg \left(z \leq 3.7 \cdot 10^{+50}\right):\\ \;\;\;\;\left(-z\right) \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 6: 68.3% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-59} \lor \neg \left(x \leq 8.5 \cdot 10^{-89}\right):\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= x -8.2e-59) (not (<= x 8.5e-89)))
                 (fma (- t x) y x)
                 (* (- y z) t)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((x <= -8.2e-59) || !(x <= 8.5e-89)) {
              		tmp = fma((t - x), y, x);
              	} else {
              		tmp = (y - z) * t;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((x <= -8.2e-59) || !(x <= 8.5e-89))
              		tmp = fma(Float64(t - x), y, x);
              	else
              		tmp = Float64(Float64(y - z) * t);
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.2e-59], N[Not[LessEqual[x, 8.5e-89]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq -8.2 \cdot 10^{-59} \lor \neg \left(x \leq 8.5 \cdot 10^{-89}\right):\\
              \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(y - z\right) \cdot t\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -8.1999999999999991e-59 or 8.49999999999999937e-89 < x

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

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

                    \[\leadsto \left(t - x\right) \cdot y + x \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
                  4. lift--.f6470.2

                    \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
                5. Applied rewrites70.2%

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

                if -8.1999999999999991e-59 < x < 8.49999999999999937e-89

                1. Initial program 100.0%

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

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

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

                    \[\leadsto \left(y - z\right) \cdot \color{blue}{t} \]
                  3. lift--.f6488.4

                    \[\leadsto \left(y - z\right) \cdot t \]
                5. Applied rewrites88.4%

                  \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification77.2%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-59} \lor \neg \left(x \leq 8.5 \cdot 10^{-89}\right):\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
              5. Add Preprocessing

              Alternative 7: 63.1% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.9 \cdot 10^{-36} \lor \neg \left(t \leq 5.8 \cdot 10^{-14}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-x, y, x\right)\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= t -3.9e-36) (not (<= t 5.8e-14))) (* (- y z) t) (fma (- x) y x)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((t <= -3.9e-36) || !(t <= 5.8e-14)) {
              		tmp = (y - z) * t;
              	} else {
              		tmp = fma(-x, y, x);
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((t <= -3.9e-36) || !(t <= 5.8e-14))
              		tmp = Float64(Float64(y - z) * t);
              	else
              		tmp = fma(Float64(-x), y, x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.9e-36], N[Not[LessEqual[t, 5.8e-14]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[((-x) * y + x), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;t \leq -3.9 \cdot 10^{-36} \lor \neg \left(t \leq 5.8 \cdot 10^{-14}\right):\\
              \;\;\;\;\left(y - z\right) \cdot t\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(-x, y, x\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if t < -3.9000000000000001e-36 or 5.8000000000000005e-14 < t

                1. Initial program 100.0%

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

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

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

                    \[\leadsto \left(y - z\right) \cdot \color{blue}{t} \]
                  3. lift--.f6477.3

                    \[\leadsto \left(y - z\right) \cdot t \]
                5. Applied rewrites77.3%

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

                if -3.9000000000000001e-36 < t < 5.8000000000000005e-14

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

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

                    \[\leadsto \left(t - x\right) \cdot y + x \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
                  4. lift--.f6466.0

                    \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
                5. Applied rewrites66.0%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
                6. Taylor expanded in x around inf

                  \[\leadsto \mathsf{fma}\left(-1 \cdot x, y, x\right) \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(x\right), y, x\right) \]
                  2. lift-neg.f6461.5

                    \[\leadsto \mathsf{fma}\left(-x, y, x\right) \]
                8. Applied rewrites61.5%

                  \[\leadsto \mathsf{fma}\left(-x, y, x\right) \]
              3. Recombined 2 regimes into one program.
              4. Final simplification70.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.9 \cdot 10^{-36} \lor \neg \left(t \leq 5.8 \cdot 10^{-14}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-x, y, x\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 8: 67.4% accurate, 0.7× speedup?

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

                1. Initial program 100.0%

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

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

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

                    \[\leadsto \left(t - x\right) \cdot \color{blue}{y} \]
                  3. lift--.f6479.1

                    \[\leadsto \left(t - x\right) \cdot y \]
                5. Applied rewrites79.1%

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

                if -1.2e15 < y < 1.4e7

                1. Initial program 100.0%

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

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

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

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

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

                    \[\leadsto \left(1 - 1 \cdot \left(y - z\right)\right) \cdot x \]
                  5. *-lft-identityN/A

                    \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                  6. lower--.f64N/A

                    \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                  7. lift--.f6455.2

                    \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                5. Applied rewrites55.2%

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

                  \[\leadsto \left(1 + z\right) \cdot x \]
                7. Step-by-step derivation
                  1. lower-+.f6453.5

                    \[\leadsto \left(1 + z\right) \cdot x \]
                8. Applied rewrites53.5%

                  \[\leadsto \left(1 + z\right) \cdot x \]
              3. Recombined 2 regimes into one program.
              4. Final simplification67.3%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+15} \lor \neg \left(y \leq 14000000\right):\\ \;\;\;\;\left(t - x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(1 + z\right) \cdot x\\ \end{array} \]
              5. Add Preprocessing

              Alternative 9: 53.8% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.12 \cdot 10^{+77} \lor \neg \left(z \leq 2.65 \cdot 10^{+103}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, y, x\right)\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= z -2.12e+77) (not (<= z 2.65e+103))) (* z x) (fma t y x)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((z <= -2.12e+77) || !(z <= 2.65e+103)) {
              		tmp = z * x;
              	} else {
              		tmp = fma(t, y, x);
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((z <= -2.12e+77) || !(z <= 2.65e+103))
              		tmp = Float64(z * x);
              	else
              		tmp = fma(t, y, x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.12e+77], N[Not[LessEqual[z, 2.65e+103]], $MachinePrecision]], N[(z * x), $MachinePrecision], N[(t * y + x), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -2.12 \cdot 10^{+77} \lor \neg \left(z \leq 2.65 \cdot 10^{+103}\right):\\
              \;\;\;\;z \cdot x\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -2.12000000000000006e77 or 2.64999999999999985e103 < z

                1. Initial program 100.0%

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

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

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

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

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

                    \[\leadsto \left(1 - 1 \cdot \left(y - z\right)\right) \cdot x \]
                  5. *-lft-identityN/A

                    \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                  6. lower--.f64N/A

                    \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                  7. lift--.f6446.7

                    \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                5. Applied rewrites46.7%

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

                  \[\leadsto z \cdot x \]
                7. Step-by-step derivation
                  1. Applied rewrites38.7%

                    \[\leadsto z \cdot x \]

                  if -2.12000000000000006e77 < z < 2.64999999999999985e103

                  1. Initial program 100.0%

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

                    \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

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

                      \[\leadsto \left(t - x\right) \cdot y + x \]
                    3. lower-fma.f64N/A

                      \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
                    4. lift--.f6482.8

                      \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
                  5. Applied rewrites82.8%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
                  6. Taylor expanded in x around 0

                    \[\leadsto \mathsf{fma}\left(t, y, x\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites57.0%

                      \[\leadsto \mathsf{fma}\left(t, y, x\right) \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification50.7%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.12 \cdot 10^{+77} \lor \neg \left(z \leq 2.65 \cdot 10^{+103}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, y, x\right)\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 10: 36.7% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-10} \lor \neg \left(z \leq 1.6 \cdot 10^{-37}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (or (<= z -4.3e-10) (not (<= z 1.6e-37))) (* z x) x))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z <= -4.3e-10) || !(z <= 1.6e-37)) {
                  		tmp = z * x;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z, t)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8) :: tmp
                      if ((z <= (-4.3d-10)) .or. (.not. (z <= 1.6d-37))) then
                          tmp = z * x
                      else
                          tmp = x
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z <= -4.3e-10) || !(z <= 1.6e-37)) {
                  		tmp = z * x;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if (z <= -4.3e-10) or not (z <= 1.6e-37):
                  		tmp = z * x
                  	else:
                  		tmp = x
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if ((z <= -4.3e-10) || !(z <= 1.6e-37))
                  		tmp = Float64(z * x);
                  	else
                  		tmp = x;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if ((z <= -4.3e-10) || ~((z <= 1.6e-37)))
                  		tmp = z * x;
                  	else
                  		tmp = x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.3e-10], N[Not[LessEqual[z, 1.6e-37]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -4.3 \cdot 10^{-10} \lor \neg \left(z \leq 1.6 \cdot 10^{-37}\right):\\
                  \;\;\;\;z \cdot x\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -4.30000000000000014e-10 or 1.5999999999999999e-37 < z

                    1. Initial program 100.0%

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

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

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

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

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

                        \[\leadsto \left(1 - 1 \cdot \left(y - z\right)\right) \cdot x \]
                      5. *-lft-identityN/A

                        \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                      6. lower--.f64N/A

                        \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                      7. lift--.f6447.0

                        \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                    5. Applied rewrites47.0%

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

                      \[\leadsto z \cdot x \]
                    7. Step-by-step derivation
                      1. Applied rewrites31.1%

                        \[\leadsto z \cdot x \]

                      if -4.30000000000000014e-10 < z < 1.5999999999999999e-37

                      1. Initial program 100.0%

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

                        \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

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

                          \[\leadsto \left(t - x\right) \cdot y + x \]
                        3. lower-fma.f64N/A

                          \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
                        4. lift--.f6493.2

                          \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
                      5. Applied rewrites93.2%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
                      6. Taylor expanded in y around 0

                        \[\leadsto x \]
                      7. Step-by-step derivation
                        1. Applied rewrites32.8%

                          \[\leadsto x \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification31.9%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-10} \lor \neg \left(z \leq 1.6 \cdot 10^{-37}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 11: 17.4% accurate, 15.0× speedup?

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

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

                        \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

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

                          \[\leadsto \left(t - x\right) \cdot y + x \]
                        3. lower-fma.f64N/A

                          \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{y}, x\right) \]
                        4. lift--.f6463.9

                          \[\leadsto \mathsf{fma}\left(t - x, y, x\right) \]
                      5. Applied rewrites63.9%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
                      6. Taylor expanded in y around 0

                        \[\leadsto x \]
                      7. Step-by-step derivation
                        1. Applied rewrites16.5%

                          \[\leadsto x \]
                        2. Add Preprocessing

                        Developer Target 1: 96.0% accurate, 0.6× speedup?

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

                        Reproduce

                        ?
                        herbie shell --seed 2025051 
                        (FPCore (x y z t)
                          :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
                          :precision binary64
                        
                          :alt
                          (! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
                        
                          (+ x (* (- y z) (- t x))))