Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 2.6s
Alternatives: 13
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}

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 13 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

Alternative 2: 37.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y - z \leq -5 \cdot 10^{+277}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y - z \leq -40:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y - z \leq 200000000000:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;z \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 y z) < -4.99999999999999982e277

    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--.f6454.6

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

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

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

        \[\leadsto y \cdot t \]

      if -4.99999999999999982e277 < (-.f64 y z) < -40 or 2e11 < (-.f64 y 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--.f6452.5

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

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

        \[\leadsto x \cdot \color{blue}{z} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto z \cdot x \]
        2. lower-*.f6428.9

          \[\leadsto z \cdot x \]
      7. Applied rewrites28.9%

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

      if -40 < (-.f64 y z) < 2e11

      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--.f6478.8

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

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

        \[\leadsto x \]
      6. Step-by-step derivation
        1. Applied rewrites60.1%

          \[\leadsto x \]
      7. Recombined 3 regimes into one program.
      8. Add Preprocessing

      Alternative 3: 67.4% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-13}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{elif}\;y \leq 7.9 \cdot 10^{+117}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (- t x) y)))
         (if (<= y -2.9e-19)
           t_1
           (if (<= y 3.2e-13) (fma z x x) (if (<= y 7.9e+117) (* (- y z) t) t_1)))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (t - x) * y;
      	double tmp;
      	if (y <= -2.9e-19) {
      		tmp = t_1;
      	} else if (y <= 3.2e-13) {
      		tmp = fma(z, x, x);
      	} else if (y <= 7.9e+117) {
      		tmp = (y - z) * t;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(t - x) * y)
      	tmp = 0.0
      	if (y <= -2.9e-19)
      		tmp = t_1;
      	elseif (y <= 3.2e-13)
      		tmp = fma(z, x, x);
      	elseif (y <= 7.9e+117)
      		tmp = Float64(Float64(y - z) * t);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.9e-19], t$95$1, If[LessEqual[y, 3.2e-13], N[(z * x + x), $MachinePrecision], If[LessEqual[y, 7.9e+117], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(t - x\right) \cdot y\\
      \mathbf{if}\;y \leq -2.9 \cdot 10^{-19}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 3.2 \cdot 10^{-13}:\\
      \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
      
      \mathbf{elif}\;y \leq 7.9 \cdot 10^{+117}:\\
      \;\;\;\;\left(y - z\right) \cdot t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -2.9e-19 or 7.90000000000000011e117 < 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.1

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

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

        if -2.9e-19 < y < 3.2e-13

        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--.f6410.5

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

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

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

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

            \[\leadsto \left(-1 \cdot x\right) \cdot \left(y - z\right) + x \]
          3. mul-1-negN/A

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

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

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

            \[\leadsto \mathsf{fma}\left(-x, y - \color{blue}{z}, x\right) \]
        7. Applied rewrites59.8%

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

          \[\leadsto x + \color{blue}{x \cdot z} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x \cdot z + x \]
          2. *-commutativeN/A

            \[\leadsto z \cdot x + x \]
          3. lower-fma.f6459.8

            \[\leadsto \mathsf{fma}\left(z, x, x\right) \]
        10. Applied rewrites59.8%

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

        if 3.2e-13 < y < 7.90000000000000011e117

        1. Initial program 99.9%

          \[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--.f6451.5

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

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

      Alternative 4: 65.4% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+97}:\\ \;\;\;\;\left(-z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (- t x) y)))
         (if (<= y -2.9e-19)
           t_1
           (if (<= y 1.95e-7) (fma z x x) (if (<= y 2.4e+97) (* (- z) t) t_1)))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (t - x) * y;
      	double tmp;
      	if (y <= -2.9e-19) {
      		tmp = t_1;
      	} else if (y <= 1.95e-7) {
      		tmp = fma(z, x, x);
      	} else if (y <= 2.4e+97) {
      		tmp = -z * t;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(t - x) * y)
      	tmp = 0.0
      	if (y <= -2.9e-19)
      		tmp = t_1;
      	elseif (y <= 1.95e-7)
      		tmp = fma(z, x, x);
      	elseif (y <= 2.4e+97)
      		tmp = Float64(Float64(-z) * t);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.9e-19], t$95$1, If[LessEqual[y, 1.95e-7], N[(z * x + x), $MachinePrecision], If[LessEqual[y, 2.4e+97], N[((-z) * t), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(t - x\right) \cdot y\\
      \mathbf{if}\;y \leq -2.9 \cdot 10^{-19}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 1.95 \cdot 10^{-7}:\\
      \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
      
      \mathbf{elif}\;y \leq 2.4 \cdot 10^{+97}:\\
      \;\;\;\;\left(-z\right) \cdot t\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -2.9e-19 or 2.4e97 < 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.2

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

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

        if -2.9e-19 < y < 1.95000000000000012e-7

        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--.f6410.7

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

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

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

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

            \[\leadsto \left(-1 \cdot x\right) \cdot \left(y - z\right) + x \]
          3. mul-1-negN/A

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

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

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

            \[\leadsto \mathsf{fma}\left(-x, y - \color{blue}{z}, x\right) \]
        7. Applied rewrites59.8%

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

          \[\leadsto x + \color{blue}{x \cdot z} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto x \cdot z + x \]
          2. *-commutativeN/A

            \[\leadsto z \cdot x + x \]
          3. lower-fma.f6459.6

            \[\leadsto \mathsf{fma}\left(z, x, x\right) \]
        10. Applied rewrites59.6%

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

        if 1.95000000000000012e-7 < y < 2.4e97

        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--.f6441.7

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

          \[\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.6%

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

        Alternative 5: 82.2% accurate, 0.6× speedup?

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

          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--.f6475.2

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

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

          if -2.9e-19 < y < 2.4e97

          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. +-commutativeN/A

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(-z, t - \color{blue}{x}, x\right) \]
          4. Applied rewrites83.8%

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

          if 2.4e97 < 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--.f6487.8

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

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

        Alternative 6: 84.2% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-z\right) \cdot \left(t - x\right)\\ \mathbf{if}\;z \leq -2700000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.028:\\ \;\;\;\;\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 -2700000000.0) t_1 (if (<= z 0.028) (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 <= -2700000000.0) {
        		tmp = t_1;
        	} else if (z <= 0.028) {
        		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 <= -2700000000.0)
        		tmp = t_1;
        	elseif (z <= 0.028)
        		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, -2700000000.0], t$95$1, If[LessEqual[z, 0.028], 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 -2700000000:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq 0.028:\\
        \;\;\;\;\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 < -2.7e9 or 0.0280000000000000006 < 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--.f6478.6

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

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

          if -2.7e9 < z < 0.0280000000000000006

          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--.f6489.4

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

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

        Alternative 7: 68.9% accurate, 0.7× speedup?

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

          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--.f6475.2

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

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

          if -2.9e-19 < y < 2.4e97

          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 + \left(y - z\right) \cdot \color{blue}{\left(t - x\right)} \]
            4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 2.4e97 < 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--.f6487.8

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

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

            Alternative 8: 68.9% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{-19}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+97}:\\ \;\;\;\;\mathsf{fma}\left(t, -z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (* (- t x) y)))
               (if (<= y -2.9e-19) t_1 (if (<= y 2.4e+97) (fma t (- z) x) t_1))))
            double code(double x, double y, double z, double t) {
            	double t_1 = (t - x) * y;
            	double tmp;
            	if (y <= -2.9e-19) {
            		tmp = t_1;
            	} else if (y <= 2.4e+97) {
            		tmp = fma(t, -z, x);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t)
            	t_1 = Float64(Float64(t - x) * y)
            	tmp = 0.0
            	if (y <= -2.9e-19)
            		tmp = t_1;
            	elseif (y <= 2.4e+97)
            		tmp = fma(t, Float64(-z), x);
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.9e-19], t$95$1, If[LessEqual[y, 2.4e+97], N[(t * (-z) + x), $MachinePrecision], t$95$1]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \left(t - x\right) \cdot y\\
            \mathbf{if}\;y \leq -2.9 \cdot 10^{-19}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;y \leq 2.4 \cdot 10^{+97}:\\
            \;\;\;\;\mathsf{fma}\left(t, -z, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -2.9e-19 or 2.4e97 < 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.2

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

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

              if -2.9e-19 < y < 2.4e97

              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 + \left(y - z\right) \cdot \color{blue}{\left(t - x\right)} \]
                4. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 9: 53.8% accurate, 0.7× speedup?

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

                  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--.f6431.4

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

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

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

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

                      \[\leadsto \left(-1 \cdot x\right) \cdot \left(y - z\right) + x \]
                    3. mul-1-negN/A

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

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

                      \[\leadsto \mathsf{fma}\left(-x, \color{blue}{y} - z, x\right) \]
                    6. lift--.f6454.3

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

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

                    \[\leadsto x + \color{blue}{x \cdot z} \]
                  9. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto x \cdot z + x \]
                    2. *-commutativeN/A

                      \[\leadsto z \cdot x + x \]
                    3. lower-fma.f6441.6

                      \[\leadsto \mathsf{fma}\left(z, x, x\right) \]
                  10. Applied rewrites41.6%

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

                  if -4.14999999999999989e-16 < z < 0.0280000000000000006

                  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--.f6490.9

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

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

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

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

                    if 0.0280000000000000006 < 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--.f6477.5

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

                      \[\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 rewrites39.8%

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

                    Alternative 10: 54.6% accurate, 0.8× speedup?

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

                      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--.f6431.7

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

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

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

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

                          \[\leadsto \left(-1 \cdot x\right) \cdot \left(y - z\right) + x \]
                        3. mul-1-negN/A

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

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

                          \[\leadsto \mathsf{fma}\left(-x, \color{blue}{y} - z, x\right) \]
                        6. lift--.f6454.2

                          \[\leadsto \mathsf{fma}\left(-x, y - \color{blue}{z}, x\right) \]
                      7. Applied rewrites54.2%

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

                        \[\leadsto x + \color{blue}{x \cdot z} \]
                      9. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto x \cdot z + x \]
                        2. *-commutativeN/A

                          \[\leadsto z \cdot x + x \]
                        3. lower-fma.f6442.4

                          \[\leadsto \mathsf{fma}\left(z, x, x\right) \]
                      10. Applied rewrites42.4%

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

                      if -4.14999999999999989e-16 < z < 3.2999999999999998e-19

                      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--.f6491.6

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

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

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

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

                      Alternative 11: 48.6% accurate, 0.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+159}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+98}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (if (<= y -5.8e+159) (* y t) (if (<= y 8.8e+98) (fma z x x) (* y t))))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (y <= -5.8e+159) {
                      		tmp = y * t;
                      	} else if (y <= 8.8e+98) {
                      		tmp = fma(z, x, x);
                      	} else {
                      		tmp = y * t;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if (y <= -5.8e+159)
                      		tmp = Float64(y * t);
                      	elseif (y <= 8.8e+98)
                      		tmp = fma(z, x, x);
                      	else
                      		tmp = Float64(y * t);
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_, t_] := If[LessEqual[y, -5.8e+159], N[(y * t), $MachinePrecision], If[LessEqual[y, 8.8e+98], N[(z * x + x), $MachinePrecision], N[(y * t), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y \leq -5.8 \cdot 10^{+159}:\\
                      \;\;\;\;y \cdot t\\
                      
                      \mathbf{elif}\;y \leq 8.8 \cdot 10^{+98}:\\
                      \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;y \cdot t\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y < -5.80000000000000029e159 or 8.80000000000000034e98 < y

                        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--.f6455.7

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

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

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

                            \[\leadsto y \cdot t \]

                          if -5.80000000000000029e159 < y < 8.80000000000000034e98

                          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--.f6427.2

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

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

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

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

                              \[\leadsto \left(-1 \cdot x\right) \cdot \left(y - z\right) + x \]
                            3. mul-1-negN/A

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

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

                              \[\leadsto \mathsf{fma}\left(-x, \color{blue}{y} - z, x\right) \]
                            6. lift--.f6457.2

                              \[\leadsto \mathsf{fma}\left(-x, y - \color{blue}{z}, x\right) \]
                          7. Applied rewrites57.2%

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

                            \[\leadsto x + \color{blue}{x \cdot z} \]
                          9. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto x \cdot z + x \]
                            2. *-commutativeN/A

                              \[\leadsto z \cdot x + x \]
                            3. lower-fma.f6448.1

                              \[\leadsto \mathsf{fma}\left(z, x, x\right) \]
                          10. Applied rewrites48.1%

                            \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
                        7. Recombined 2 regimes into one program.
                        8. Add Preprocessing

                        Alternative 12: 37.1% accurate, 0.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+33}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (<= z -2.35e+33) (* z x) (if (<= z 1.0) x (* z x))))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if (z <= -2.35e+33) {
                        		tmp = z * x;
                        	} else if (z <= 1.0) {
                        		tmp = x;
                        	} 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.35d+33)) then
                                tmp = z * x
                            else if (z <= 1.0d0) then
                                tmp = x
                            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.35e+33) {
                        		tmp = z * x;
                        	} else if (z <= 1.0) {
                        		tmp = x;
                        	} else {
                        		tmp = z * x;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if z <= -2.35e+33:
                        		tmp = z * x
                        	elif z <= 1.0:
                        		tmp = x
                        	else:
                        		tmp = z * x
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if (z <= -2.35e+33)
                        		tmp = Float64(z * x);
                        	elseif (z <= 1.0)
                        		tmp = x;
                        	else
                        		tmp = Float64(z * x);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if (z <= -2.35e+33)
                        		tmp = z * x;
                        	elseif (z <= 1.0)
                        		tmp = x;
                        	else
                        		tmp = z * x;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[LessEqual[z, -2.35e+33], N[(z * x), $MachinePrecision], If[LessEqual[z, 1.0], x, N[(z * x), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;z \leq -2.35 \cdot 10^{+33}:\\
                        \;\;\;\;z \cdot x\\
                        
                        \mathbf{elif}\;z \leq 1:\\
                        \;\;\;\;x\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;z \cdot x\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if z < -2.3499999999999999e33 or 1 < 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)} \]
                          5. Taylor expanded in x around inf

                            \[\leadsto x \cdot \color{blue}{z} \]
                          6. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto z \cdot x \]
                            2. lower-*.f6444.0

                              \[\leadsto z \cdot x \]
                          7. Applied rewrites44.0%

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

                          if -2.3499999999999999e33 < z < 1

                          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.0

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

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

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

                              \[\leadsto x \]
                          7. Recombined 2 regimes into one program.
                          8. Add Preprocessing

                          Alternative 13: 17.9% 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. 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--.f6460.8

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

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

                            \[\leadsto x \]
                          6. Step-by-step derivation
                            1. Applied rewrites17.9%

                              \[\leadsto x \]
                            2. Add Preprocessing

                            Developer Target 1: 96.3% 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 2025095 
                            (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))))