Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3

Percentage Accurate: 96.9% → 96.9%
Time: 7.9s
Alternatives: 12
Speedup: 1.0×

Specification

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

\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 96.9% accurate, 1.0× speedup?

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

\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}

Alternative 1: 96.9% accurate, 1.0× speedup?

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

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

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 75.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{a}{t} \cdot \left(y - z\right)\\ \mathbf{if}\;t \leq -2.7 \cdot 10^{+45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.9 \cdot 10^{-85}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{1 - z}, a, x\right)\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-23}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;t \leq 1.06 \cdot 10^{+25}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* (/ a t) (- y z)))))
   (if (<= t -2.7e+45)
     t_1
     (if (<= t -1.9e-85)
       (fma (/ z (- 1.0 z)) a x)
       (if (<= t 2.05e-23) (- x (* a y)) (if (<= t 1.06e+25) (- x a) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((a / t) * (y - z));
	double tmp;
	if (t <= -2.7e+45) {
		tmp = t_1;
	} else if (t <= -1.9e-85) {
		tmp = fma((z / (1.0 - z)), a, x);
	} else if (t <= 2.05e-23) {
		tmp = x - (a * y);
	} else if (t <= 1.06e+25) {
		tmp = x - a;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(a / t) * Float64(y - z)))
	tmp = 0.0
	if (t <= -2.7e+45)
		tmp = t_1;
	elseif (t <= -1.9e-85)
		tmp = fma(Float64(z / Float64(1.0 - z)), a, x);
	elseif (t <= 2.05e-23)
		tmp = Float64(x - Float64(a * y));
	elseif (t <= 1.06e+25)
		tmp = Float64(x - a);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(a / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+45], t$95$1, If[LessEqual[t, -1.9e-85], N[(N[(z / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[t, 2.05e-23], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.06e+25], N[(x - a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - \frac{a}{t} \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.9 \cdot 10^{-85}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{1 - z}, a, x\right)\\

\mathbf{elif}\;t \leq 2.05 \cdot 10^{-23}:\\
\;\;\;\;x - a \cdot y\\

\mathbf{elif}\;t \leq 1.06 \cdot 10^{+25}:\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.69999999999999984e45 or 1.06e25 < t

    1. Initial program 98.1%

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{\left(y - z\right) \cdot a}}{t} \]
      4. lower--.f6475.0

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

      \[\leadsto x - \color{blue}{\frac{\left(y - z\right) \cdot a}{t}} \]
    6. Step-by-step derivation
      1. Applied rewrites88.7%

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

      if -2.69999999999999984e45 < t < -1.8999999999999999e-85

      1. Initial program 96.2%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
        8. lower-/.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{\left(1 + t\right) - z}}, a, x\right) \]
        9. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right) - z}}, a, x\right) \]
        10. lower-+.f6485.6

          \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right)} - z}, a, x\right) \]
      5. Applied rewrites85.6%

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]
      7. Step-by-step derivation
        1. Applied rewrites85.6%

          \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]

        if -1.8999999999999999e-85 < t < 2.05000000000000015e-23

        1. Initial program 98.2%

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

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

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

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

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

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

            \[\leadsto x - \left(y - z\right) \cdot \color{blue}{\frac{a}{1 - z}} \]
          6. lower--.f6498.9

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

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

          \[\leadsto x - a \cdot \color{blue}{y} \]
        7. Step-by-step derivation
          1. Applied rewrites72.0%

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

          if 2.05000000000000015e-23 < t < 1.06e25

          1. Initial program 99.8%

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

            \[\leadsto \color{blue}{x - a} \]
          4. Step-by-step derivation
            1. lower--.f6490.0

              \[\leadsto \color{blue}{x - a} \]
          5. Applied rewrites90.0%

            \[\leadsto \color{blue}{x - a} \]
        8. Recombined 4 regimes into one program.
        9. Add Preprocessing

        Alternative 3: 90.4% accurate, 0.9× speedup?

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

          1. Initial program 98.1%

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

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

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

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

              \[\leadsto x - \frac{\color{blue}{\left(y - z\right) \cdot a}}{t} \]
            4. lower--.f6475.0

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

            \[\leadsto x - \color{blue}{\frac{\left(y - z\right) \cdot a}{t}} \]
          6. Step-by-step derivation
            1. Applied rewrites88.7%

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

            if -2.69999999999999984e45 < t < 1.1e25

            1. Initial program 98.0%

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

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

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

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

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

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

                \[\leadsto x - \left(y - z\right) \cdot \color{blue}{\frac{a}{1 - z}} \]
              6. lower--.f6497.6

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

              \[\leadsto x - \color{blue}{\left(y - z\right) \cdot \frac{a}{1 - z}} \]
          7. Recombined 2 regimes into one program.
          8. Final simplification93.9%

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

          Alternative 4: 90.4% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+45}:\\ \;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+25}:\\ \;\;\;\;x - \left(y - z\right) \cdot \frac{a}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{a}{t} \cdot \left(y - z\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (if (<= t -2.7e+45)
             (- x (/ (- y z) (/ t a)))
             (if (<= t 1.1e+25)
               (- x (* (- y z) (/ a (- 1.0 z))))
               (- x (* (/ a t) (- y z))))))
          double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (t <= -2.7e+45) {
          		tmp = x - ((y - z) / (t / a));
          	} else if (t <= 1.1e+25) {
          		tmp = x - ((y - z) * (a / (1.0 - z)));
          	} else {
          		tmp = x - ((a / t) * (y - z));
          	}
          	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, a)
          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), intent (in) :: a
              real(8) :: tmp
              if (t <= (-2.7d+45)) then
                  tmp = x - ((y - z) / (t / a))
              else if (t <= 1.1d+25) then
                  tmp = x - ((y - z) * (a / (1.0d0 - z)))
              else
                  tmp = x - ((a / t) * (y - z))
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double tmp;
          	if (t <= -2.7e+45) {
          		tmp = x - ((y - z) / (t / a));
          	} else if (t <= 1.1e+25) {
          		tmp = x - ((y - z) * (a / (1.0 - z)));
          	} else {
          		tmp = x - ((a / t) * (y - z));
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	tmp = 0
          	if t <= -2.7e+45:
          		tmp = x - ((y - z) / (t / a))
          	elif t <= 1.1e+25:
          		tmp = x - ((y - z) * (a / (1.0 - z)))
          	else:
          		tmp = x - ((a / t) * (y - z))
          	return tmp
          
          function code(x, y, z, t, a)
          	tmp = 0.0
          	if (t <= -2.7e+45)
          		tmp = Float64(x - Float64(Float64(y - z) / Float64(t / a)));
          	elseif (t <= 1.1e+25)
          		tmp = Float64(x - Float64(Float64(y - z) * Float64(a / Float64(1.0 - z))));
          	else
          		tmp = Float64(x - Float64(Float64(a / t) * Float64(y - z)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	tmp = 0.0;
          	if (t <= -2.7e+45)
          		tmp = x - ((y - z) / (t / a));
          	elseif (t <= 1.1e+25)
          		tmp = x - ((y - z) * (a / (1.0 - z)));
          	else
          		tmp = x - ((a / t) * (y - z));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e+45], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e+25], N[(x - N[(N[(y - z), $MachinePrecision] * N[(a / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(a / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq -2.7 \cdot 10^{+45}:\\
          \;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\
          
          \mathbf{elif}\;t \leq 1.1 \cdot 10^{+25}:\\
          \;\;\;\;x - \left(y - z\right) \cdot \frac{a}{1 - z}\\
          
          \mathbf{else}:\\
          \;\;\;\;x - \frac{a}{t} \cdot \left(y - z\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if t < -2.69999999999999984e45

            1. Initial program 97.6%

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

              \[\leadsto x - \frac{y - z}{\color{blue}{\frac{t}{a}}} \]
            4. Step-by-step derivation
              1. lower-/.f6485.5

                \[\leadsto x - \frac{y - z}{\color{blue}{\frac{t}{a}}} \]
            5. Applied rewrites85.5%

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

            if -2.69999999999999984e45 < t < 1.1e25

            1. Initial program 98.0%

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

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

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

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

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

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

                \[\leadsto x - \left(y - z\right) \cdot \color{blue}{\frac{a}{1 - z}} \]
              6. lower--.f6497.6

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

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

            if 1.1e25 < t

            1. Initial program 98.5%

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

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

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

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

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

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

              \[\leadsto x - \color{blue}{\frac{\left(y - z\right) \cdot a}{t}} \]
            6. Step-by-step derivation
              1. Applied rewrites90.9%

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

            Alternative 5: 88.4% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.71 \lor \neg \left(z \leq 5900\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{1 + t} \cdot a\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (if (or (<= z -0.71) (not (<= z 5900.0)))
               (fma (/ z (- (+ 1.0 t) z)) a x)
               (- x (* (/ y (+ 1.0 t)) a))))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if ((z <= -0.71) || !(z <= 5900.0)) {
            		tmp = fma((z / ((1.0 + t) - z)), a, x);
            	} else {
            		tmp = x - ((y / (1.0 + t)) * a);
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if ((z <= -0.71) || !(z <= 5900.0))
            		tmp = fma(Float64(z / Float64(Float64(1.0 + t) - z)), a, x);
            	else
            		tmp = Float64(x - Float64(Float64(y / Float64(1.0 + t)) * a));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.71], N[Not[LessEqual[z, 5900.0]], $MachinePrecision]], N[(N[(z / N[(N[(1.0 + t), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision], N[(x - N[(N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -0.71 \lor \neg \left(z \leq 5900\right):\\
            \;\;\;\;\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x - \frac{y}{1 + t} \cdot a\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -0.70999999999999996 or 5900 < z

              1. Initial program 96.9%

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
                8. lower-/.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{\left(1 + t\right) - z}}, a, x\right) \]
                9. lower--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right) - z}}, a, x\right) \]
                10. lower-+.f6485.9

                  \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right)} - z}, a, x\right) \]
              5. Applied rewrites85.9%

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

              if -0.70999999999999996 < z < 5900

              1. Initial program 99.1%

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

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

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

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

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

                  \[\leadsto x - \color{blue}{\frac{y}{1 + t}} \cdot a \]
                5. lower-+.f6493.3

                  \[\leadsto x - \frac{y}{\color{blue}{1 + t}} \cdot a \]
              5. Applied rewrites93.3%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.71 \lor \neg \left(z \leq 5900\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{1 + t} \cdot a\\ \end{array} \]
            5. Add Preprocessing

            Alternative 6: 86.7% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.71 \lor \neg \left(z \leq 5900\right):\\ \;\;\;\;\mathsf{fma}\left(z, \frac{a}{\left(1 + t\right) - z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{1 + t} \cdot a\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (if (or (<= z -0.71) (not (<= z 5900.0)))
               (fma z (/ a (- (+ 1.0 t) z)) x)
               (- x (* (/ y (+ 1.0 t)) a))))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if ((z <= -0.71) || !(z <= 5900.0)) {
            		tmp = fma(z, (a / ((1.0 + t) - z)), x);
            	} else {
            		tmp = x - ((y / (1.0 + t)) * a);
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if ((z <= -0.71) || !(z <= 5900.0))
            		tmp = fma(z, Float64(a / Float64(Float64(1.0 + t) - z)), x);
            	else
            		tmp = Float64(x - Float64(Float64(y / Float64(1.0 + t)) * a));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.71], N[Not[LessEqual[z, 5900.0]], $MachinePrecision]], N[(z * N[(a / N[(N[(1.0 + t), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -0.71 \lor \neg \left(z \leq 5900\right):\\
            \;\;\;\;\mathsf{fma}\left(z, \frac{a}{\left(1 + t\right) - z}, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x - \frac{y}{1 + t} \cdot a\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -0.70999999999999996 or 5900 < z

              1. Initial program 96.9%

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
                8. lower-/.f64N/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{\left(1 + t\right) - z}}, a, x\right) \]
                9. lower--.f64N/A

                  \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right) - z}}, a, x\right) \]
                10. lower-+.f6485.9

                  \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right)} - z}, a, x\right) \]
              5. Applied rewrites85.9%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites84.4%

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

                if -0.70999999999999996 < z < 5900

                1. Initial program 99.1%

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

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

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

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

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

                    \[\leadsto x - \color{blue}{\frac{y}{1 + t}} \cdot a \]
                  5. lower-+.f6493.3

                    \[\leadsto x - \frac{y}{\color{blue}{1 + t}} \cdot a \]
                5. Applied rewrites93.3%

                  \[\leadsto x - \color{blue}{\frac{y}{1 + t} \cdot a} \]
              7. Recombined 2 regimes into one program.
              8. Final simplification88.9%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.71 \lor \neg \left(z \leq 5900\right):\\ \;\;\;\;\mathsf{fma}\left(z, \frac{a}{\left(1 + t\right) - z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{1 + t} \cdot a\\ \end{array} \]
              9. Add Preprocessing

              Alternative 7: 74.1% accurate, 1.0× speedup?

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

                1. Initial program 97.2%

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
                  8. lower-/.f64N/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{\left(1 + t\right) - z}}, a, x\right) \]
                  9. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right) - z}}, a, x\right) \]
                  10. lower-+.f6483.4

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites78.3%

                    \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]

                  if -1.57999999999999997e-10 < z < 5.00000000000000028e-33

                  1. Initial program 99.1%

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

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

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

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

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

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

                      \[\leadsto x - \left(y - z\right) \cdot \color{blue}{\frac{a}{1 - z}} \]
                    6. lower--.f6476.4

                      \[\leadsto x - \left(y - z\right) \cdot \frac{a}{\color{blue}{1 - z}} \]
                  5. Applied rewrites76.4%

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

                    \[\leadsto x - \left(y - z\right) \cdot \frac{a}{1} \]
                  7. Step-by-step derivation
                    1. Applied rewrites76.4%

                      \[\leadsto x - \left(y - z\right) \cdot \frac{a}{1} \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification77.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.58 \cdot 10^{-10} \lor \neg \left(z \leq 5 \cdot 10^{-33}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{1 - z}, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \left(y - z\right) \cdot \frac{a}{1}\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 8: 84.0% accurate, 1.0× speedup?

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

                    1. Initial program 97.0%

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
                      8. lower-/.f64N/A

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{\left(1 + t\right) - z}}, a, x\right) \]
                      9. lower--.f64N/A

                        \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right) - z}}, a, x\right) \]
                      10. lower-+.f6487.1

                        \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right)} - z}, a, x\right) \]
                    5. Applied rewrites87.1%

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

                      \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites81.9%

                        \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]

                      if -0.78000000000000003 < z < 1.5500000000000001e31

                      1. Initial program 98.5%

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

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

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

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

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

                          \[\leadsto x - \color{blue}{\frac{y}{1 + t}} \cdot a \]
                        5. lower-+.f6492.0

                          \[\leadsto x - \frac{y}{\color{blue}{1 + t}} \cdot a \]
                      5. Applied rewrites92.0%

                        \[\leadsto x - \color{blue}{\frac{y}{1 + t} \cdot a} \]

                      if 1.5500000000000001e31 < z

                      1. Initial program 98.1%

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

                        \[\leadsto \color{blue}{x - a} \]
                      4. Step-by-step derivation
                        1. lower--.f6482.4

                          \[\leadsto \color{blue}{x - a} \]
                      5. Applied rewrites82.4%

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

                    Alternative 9: 72.8% accurate, 1.1× speedup?

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

                      1. Initial program 97.2%

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
                        8. lower-/.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{\left(1 + t\right) - z}}, a, x\right) \]
                        9. lower--.f64N/A

                          \[\leadsto \mathsf{fma}\left(\frac{z}{\color{blue}{\left(1 + t\right) - z}}, a, x\right) \]
                        10. lower-+.f6483.4

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites78.3%

                          \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]

                        if -1.57999999999999997e-10 < z < 1.25000000000000007e-33

                        1. Initial program 99.1%

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

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

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

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

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

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

                            \[\leadsto x - \left(y - z\right) \cdot \color{blue}{\frac{a}{1 - z}} \]
                          6. lower--.f6476.4

                            \[\leadsto x - \left(y - z\right) \cdot \frac{a}{\color{blue}{1 - z}} \]
                        5. Applied rewrites76.4%

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

                          \[\leadsto x - a \cdot \color{blue}{y} \]
                        7. Step-by-step derivation
                          1. Applied rewrites74.9%

                            \[\leadsto x - a \cdot \color{blue}{y} \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification76.8%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.58 \cdot 10^{-10} \lor \neg \left(z \leq 1.25 \cdot 10^{-33}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{1 - z}, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot y\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 10: 71.9% accurate, 1.7× speedup?

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

                          1. Initial program 96.8%

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

                            \[\leadsto \color{blue}{x - a} \]
                          4. Step-by-step derivation
                            1. lower--.f6479.3

                              \[\leadsto \color{blue}{x - a} \]
                          5. Applied rewrites79.3%

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

                          if -2.3e61 < z < 5.00000000000000028e-33

                          1. Initial program 99.2%

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

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

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

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

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

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

                              \[\leadsto x - \left(y - z\right) \cdot \color{blue}{\frac{a}{1 - z}} \]
                            6. lower--.f6477.9

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

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

                            \[\leadsto x - a \cdot \color{blue}{y} \]
                          7. Step-by-step derivation
                            1. Applied rewrites73.9%

                              \[\leadsto x - a \cdot \color{blue}{y} \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification76.5%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+61} \lor \neg \left(z \leq 5 \cdot 10^{-33}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot y\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 11: 59.5% accurate, 8.8× speedup?

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

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

                            \[\leadsto \color{blue}{x - a} \]
                          4. Step-by-step derivation
                            1. lower--.f6460.3

                              \[\leadsto \color{blue}{x - a} \]
                          5. Applied rewrites60.3%

                            \[\leadsto \color{blue}{x - a} \]
                          6. Add Preprocessing

                          Alternative 12: 16.4% accurate, 11.7× speedup?

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

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

                            \[\leadsto \color{blue}{x - a} \]
                          4. Step-by-step derivation
                            1. lower--.f6460.3

                              \[\leadsto \color{blue}{x - a} \]
                          5. Applied rewrites60.3%

                            \[\leadsto \color{blue}{x - a} \]
                          6. Taylor expanded in x around 0

                            \[\leadsto -1 \cdot \color{blue}{a} \]
                          7. Step-by-step derivation
                            1. Applied rewrites14.9%

                              \[\leadsto -a \]
                            2. Add Preprocessing

                            Developer Target 1: 99.6% accurate, 1.2× speedup?

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

                            Reproduce

                            ?
                            herbie shell --seed 2024359 
                            (FPCore (x y z t a)
                              :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
                              :precision binary64
                            
                              :alt
                              (! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
                            
                              (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))