Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 3.0s
Alternatives: 10
Speedup: 1.1×

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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 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.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y - z, t - x, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
	return fma((y - z), (t - x), x);
}
function code(x, y, z, t)
	return fma(Float64(y - z), Float64(t - x), x)
end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
    7. lift--.f64N/A

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{t - x}, x\right) \]
  3. Applied rewrites100.0%

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

Alternative 2: 84.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - x, y, x\right)\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.29999999999999991e-10 or 9.5999999999999999e33 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
    3. 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--.f6479.6

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

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

    if -1.29999999999999991e-10 < y < 9.5999999999999999e33

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto x - \left(t - x\right) \cdot z \]
    4. Applied rewrites87.2%

      \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 83.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 76000:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9e21 or 76000 < z

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
    3. 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--.f6479.8

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

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

    if -9e21 < z < 76000

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
    3. 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--.f6488.5

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

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

Alternative 4: 70.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -4.6 \cdot 10^{-87}:\\
\;\;\;\;\left(y - z\right) \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.15e21 or 1.9999999999999999e-48 < z

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
    3. 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.2

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

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

    if -2.15e21 < z < -4.6000000000000003e-87

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    3. 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--.f6450.3

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

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

    if -4.6000000000000003e-87 < z < 1.9999999999999999e-48

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
      7. lift--.f64N/A

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{t - x}, x\right) \]
    3. Applied rewrites100.0%

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{t}, x\right) \]
    5. Step-by-step derivation
      1. Applied rewrites76.0%

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{y}, t, x\right) \]
      3. Step-by-step derivation
        1. Applied rewrites69.6%

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

      Alternative 5: 62.9% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - y\right) \cdot x\\ \mathbf{if}\;x \leq -5.2 \cdot 10^{+33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+80}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (- 1.0 y) x)))
         (if (<= x -5.2e+33) t_1 (if (<= x 2.6e+80) (* (- y z) t) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (1.0 - y) * x;
      	double tmp;
      	if (x <= -5.2e+33) {
      		tmp = t_1;
      	} else if (x <= 2.6e+80) {
      		tmp = (y - z) * t;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8) :: t_1
          real(8) :: tmp
          t_1 = (1.0d0 - y) * x
          if (x <= (-5.2d+33)) then
              tmp = t_1
          else if (x <= 2.6d+80) then
              tmp = (y - z) * t
          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 = (1.0 - y) * x;
      	double tmp;
      	if (x <= -5.2e+33) {
      		tmp = t_1;
      	} else if (x <= 2.6e+80) {
      		tmp = (y - z) * t;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = (1.0 - y) * x
      	tmp = 0
      	if x <= -5.2e+33:
      		tmp = t_1
      	elif x <= 2.6e+80:
      		tmp = (y - z) * t
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(1.0 - y) * x)
      	tmp = 0.0
      	if (x <= -5.2e+33)
      		tmp = t_1;
      	elseif (x <= 2.6e+80)
      		tmp = Float64(Float64(y - z) * t);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = (1.0 - y) * x;
      	tmp = 0.0;
      	if (x <= -5.2e+33)
      		tmp = t_1;
      	elseif (x <= 2.6e+80)
      		tmp = (y - z) * t;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -5.2e+33], t$95$1, If[LessEqual[x, 2.6e+80], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(1 - y\right) \cdot x\\
      \mathbf{if}\;x \leq -5.2 \cdot 10^{+33}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 2.6 \cdot 10^{+80}:\\
      \;\;\;\;\left(y - z\right) \cdot t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -5.1999999999999995e33 or 2.59999999999999982e80 < x

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
        3. 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--.f6486.0

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

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

          \[\leadsto \left(1 - y\right) \cdot x \]
        6. Step-by-step derivation
          1. Applied rewrites58.2%

            \[\leadsto \left(1 - y\right) \cdot x \]

          if -5.1999999999999995e33 < x < 2.59999999999999982e80

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
          3. 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--.f6466.2

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

            \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 6: 55.1% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ \mathbf{if}\;z \leq -4.4 \cdot 10^{+117}:\\ \;\;\;\;\left(-z\right) \cdot t\\ \mathbf{elif}\;z \leq -2.85 \cdot 10^{-236}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-82}:\\ \;\;\;\;\mathsf{fma}\left(y, t, x\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* (- t x) y)))
           (if (<= z -4.4e+117)
             (* (- z) t)
             (if (<= z -2.85e-236)
               t_1
               (if (<= z 3.6e-82) (fma y t x) (if (<= z 1.45e+24) t_1 (* z x)))))))
        double code(double x, double y, double z, double t) {
        	double t_1 = (t - x) * y;
        	double tmp;
        	if (z <= -4.4e+117) {
        		tmp = -z * t;
        	} else if (z <= -2.85e-236) {
        		tmp = t_1;
        	} else if (z <= 3.6e-82) {
        		tmp = fma(y, t, x);
        	} else if (z <= 1.45e+24) {
        		tmp = t_1;
        	} else {
        		tmp = z * x;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(Float64(t - x) * y)
        	tmp = 0.0
        	if (z <= -4.4e+117)
        		tmp = Float64(Float64(-z) * t);
        	elseif (z <= -2.85e-236)
        		tmp = t_1;
        	elseif (z <= 3.6e-82)
        		tmp = fma(y, t, x);
        	elseif (z <= 1.45e+24)
        		tmp = t_1;
        	else
        		tmp = Float64(z * x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[z, -4.4e+117], N[((-z) * t), $MachinePrecision], If[LessEqual[z, -2.85e-236], t$95$1, If[LessEqual[z, 3.6e-82], N[(y * t + x), $MachinePrecision], If[LessEqual[z, 1.45e+24], t$95$1, N[(z * x), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left(t - x\right) \cdot y\\
        \mathbf{if}\;z \leq -4.4 \cdot 10^{+117}:\\
        \;\;\;\;\left(-z\right) \cdot t\\
        
        \mathbf{elif}\;z \leq -2.85 \cdot 10^{-236}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq 3.6 \cdot 10^{-82}:\\
        \;\;\;\;\mathsf{fma}\left(y, t, x\right)\\
        
        \mathbf{elif}\;z \leq 1.45 \cdot 10^{+24}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{else}:\\
        \;\;\;\;z \cdot x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if z < -4.40000000000000028e117

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
          3. 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--.f6488.2

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

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

            \[\leadsto \left(-z\right) \cdot t \]
          6. Step-by-step derivation
            1. Applied rewrites48.3%

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

            if -4.40000000000000028e117 < z < -2.84999999999999993e-236 or 3.59999999999999998e-82 < z < 1.4499999999999999e24

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
            3. 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--.f6453.4

                \[\leadsto \left(t - x\right) \cdot y \]
            4. Applied rewrites53.4%

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

            if -2.84999999999999993e-236 < z < 3.59999999999999998e-82

            1. Initial program 100.0%

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
              7. lift--.f64N/A

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

                \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{t - x}, x\right) \]
            3. Applied rewrites100.0%

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

              \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{t}, x\right) \]
            5. Step-by-step derivation
              1. Applied rewrites76.3%

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{y}, t, x\right) \]
              3. Step-by-step derivation
                1. Applied rewrites71.2%

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

                if 1.4499999999999999e24 < z

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                3. 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.7

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

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

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

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

                Alternative 7: 53.4% accurate, 0.7× speedup?

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

                  1. Initial program 100.0%

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

                    \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                  3. 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--.f6453.9

                      \[\leadsto \left(1 - \left(y - z\right)\right) \cdot x \]
                  4. Applied rewrites53.9%

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

                    \[\leadsto z \cdot x \]
                  6. Step-by-step derivation
                    1. Applied rewrites43.0%

                      \[\leadsto z \cdot x \]

                    if -2.15e21 < z < 1.9999999999999999e-48

                    1. Initial program 100.0%

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
                      7. lift--.f64N/A

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

                        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{t - x}, x\right) \]
                    3. Applied rewrites100.0%

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

                      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{t}, x\right) \]
                    5. Step-by-step derivation
                      1. Applied rewrites74.7%

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

                        \[\leadsto \mathsf{fma}\left(\color{blue}{y}, t, x\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites66.1%

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

                        if 1.9999999999999999e-48 < z < 4.8e6

                        1. Initial program 99.9%

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

                          \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
                        3. 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--.f6425.2

                            \[\leadsto \left(-z\right) \cdot \left(t - \color{blue}{x}\right) \]
                        4. Applied rewrites25.2%

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

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

                            \[\leadsto \left(-z\right) \cdot t \]
                        7. Recombined 3 regimes into one program.
                        8. Add Preprocessing

                        Alternative 8: 39.2% accurate, 0.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-8}:\\ \;\;\;\;\left(-x\right) \cdot y\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-162}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+33}:\\ \;\;\;\;\left(-z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot y\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (<= y -4.2e-8)
                           (* (- x) y)
                           (if (<= y -2.2e-162) (* z x) (if (<= y 9.6e+33) (* (- z) t) (* t y)))))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if (y <= -4.2e-8) {
                        		tmp = -x * y;
                        	} else if (y <= -2.2e-162) {
                        		tmp = z * x;
                        	} else if (y <= 9.6e+33) {
                        		tmp = -z * t;
                        	} 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 (y <= (-4.2d-8)) then
                                tmp = -x * y
                            else if (y <= (-2.2d-162)) then
                                tmp = z * x
                            else if (y <= 9.6d+33) then
                                tmp = -z * t
                            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 (y <= -4.2e-8) {
                        		tmp = -x * y;
                        	} else if (y <= -2.2e-162) {
                        		tmp = z * x;
                        	} else if (y <= 9.6e+33) {
                        		tmp = -z * t;
                        	} else {
                        		tmp = t * y;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if y <= -4.2e-8:
                        		tmp = -x * y
                        	elif y <= -2.2e-162:
                        		tmp = z * x
                        	elif y <= 9.6e+33:
                        		tmp = -z * t
                        	else:
                        		tmp = t * y
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if (y <= -4.2e-8)
                        		tmp = Float64(Float64(-x) * y);
                        	elseif (y <= -2.2e-162)
                        		tmp = Float64(z * x);
                        	elseif (y <= 9.6e+33)
                        		tmp = Float64(Float64(-z) * t);
                        	else
                        		tmp = Float64(t * y);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if (y <= -4.2e-8)
                        		tmp = -x * y;
                        	elseif (y <= -2.2e-162)
                        		tmp = z * x;
                        	elseif (y <= 9.6e+33)
                        		tmp = -z * t;
                        	else
                        		tmp = t * y;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e-8], N[((-x) * y), $MachinePrecision], If[LessEqual[y, -2.2e-162], N[(z * x), $MachinePrecision], If[LessEqual[y, 9.6e+33], N[((-z) * t), $MachinePrecision], N[(t * y), $MachinePrecision]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;y \leq -4.2 \cdot 10^{-8}:\\
                        \;\;\;\;\left(-x\right) \cdot y\\
                        
                        \mathbf{elif}\;y \leq -2.2 \cdot 10^{-162}:\\
                        \;\;\;\;z \cdot x\\
                        
                        \mathbf{elif}\;y \leq 9.6 \cdot 10^{+33}:\\
                        \;\;\;\;\left(-z\right) \cdot t\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t \cdot y\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if y < -4.19999999999999989e-8

                          1. Initial program 100.0%

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

                            \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                          3. 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--.f6477.9

                              \[\leadsto \left(t - x\right) \cdot y \]
                          4. Applied rewrites77.9%

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

                            \[\leadsto \left(-1 \cdot x\right) \cdot y \]
                          6. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \left(\mathsf{neg}\left(x\right)\right) \cdot y \]
                            2. lower-neg.f6442.6

                              \[\leadsto \left(-x\right) \cdot y \]
                          7. Applied rewrites42.6%

                            \[\leadsto \left(-x\right) \cdot y \]

                          if -4.19999999999999989e-8 < y < -2.1999999999999999e-162

                          1. Initial program 100.0%

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

                            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                          3. 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.6

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

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

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

                              \[\leadsto z \cdot x \]

                            if -2.1999999999999999e-162 < y < 9.5999999999999999e33

                            1. Initial program 100.0%

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

                              \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
                            3. 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--.f6457.9

                                \[\leadsto \left(-z\right) \cdot \left(t - \color{blue}{x}\right) \]
                            4. Applied rewrites57.9%

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

                              \[\leadsto \left(-z\right) \cdot t \]
                            6. Step-by-step derivation
                              1. Applied rewrites35.4%

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

                              if 9.5999999999999999e33 < y

                              1. Initial program 100.0%

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

                                \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                              3. 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--.f6480.8

                                  \[\leadsto \left(t - x\right) \cdot y \]
                              4. Applied rewrites80.8%

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

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

                                  \[\leadsto t \cdot y \]
                              7. Recombined 4 regimes into one program.
                              8. Add Preprocessing

                              Alternative 9: 38.3% accurate, 1.0× speedup?

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

                                1. Initial program 100.0%

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

                                  \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                                3. 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--.f6453.8

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

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

                                  \[\leadsto z \cdot x \]
                                6. Step-by-step derivation
                                  1. Applied rewrites43.0%

                                    \[\leadsto z \cdot x \]

                                  if -2.15e21 < z < 3.4e5

                                  1. Initial program 100.0%

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

                                    \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                                  3. 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--.f6459.3

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

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

                                    \[\leadsto t \cdot y \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites35.9%

                                      \[\leadsto t \cdot y \]
                                  7. Recombined 2 regimes into one program.
                                  8. Add Preprocessing

                                  Alternative 10: 22.1% accurate, 3.0× speedup?

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

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

                                    \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                                  3. 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--.f6456.5

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

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

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

                                      \[\leadsto z \cdot x \]
                                    2. Add Preprocessing

                                    Reproduce

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