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

Percentage Accurate: 97.1% → 99.0%
Time: 6.1s
Alternatives: 12
Speedup: 0.7×

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: 97.1% 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: 99.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - z\right) - -1\\ \mathbf{if}\;a \leq -1.7 \cdot 10^{+81} \lor \neg \left(a \leq 200000000000\right):\\ \;\;\;\;x - \frac{y - z}{\frac{t\_1}{a}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\left(y - z\right) \cdot a}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (- t z) -1.0)))
   (if (or (<= a -1.7e+81) (not (<= a 200000000000.0)))
     (- x (/ (- y z) (/ t_1 a)))
     (- x (/ (* (- y z) a) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - z) - -1.0;
	double tmp;
	if ((a <= -1.7e+81) || !(a <= 200000000000.0)) {
		tmp = x - ((y - z) / (t_1 / a));
	} else {
		tmp = x - (((y - z) * a) / t_1);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, 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) :: t_1
    real(8) :: tmp
    t_1 = (t - z) - (-1.0d0)
    if ((a <= (-1.7d+81)) .or. (.not. (a <= 200000000000.0d0))) then
        tmp = x - ((y - z) / (t_1 / a))
    else
        tmp = x - (((y - z) * a) / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - z) - -1.0;
	double tmp;
	if ((a <= -1.7e+81) || !(a <= 200000000000.0)) {
		tmp = x - ((y - z) / (t_1 / a));
	} else {
		tmp = x - (((y - z) * a) / t_1);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (t - z) - -1.0
	tmp = 0
	if (a <= -1.7e+81) or not (a <= 200000000000.0):
		tmp = x - ((y - z) / (t_1 / a))
	else:
		tmp = x - (((y - z) * a) / t_1)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - z) - -1.0)
	tmp = 0.0
	if ((a <= -1.7e+81) || !(a <= 200000000000.0))
		tmp = Float64(x - Float64(Float64(y - z) / Float64(t_1 / a)));
	else
		tmp = Float64(x - Float64(Float64(Float64(y - z) * a) / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (t - z) - -1.0;
	tmp = 0.0;
	if ((a <= -1.7e+81) || ~((a <= 200000000000.0)))
		tmp = x - ((y - z) / (t_1 / a));
	else
		tmp = x - (((y - z) * a) / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] - -1.0), $MachinePrecision]}, If[Or[LessEqual[a, -1.7e+81], N[Not[LessEqual[a, 200000000000.0]], $MachinePrecision]], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(y - z), $MachinePrecision] * a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(t - z\right) - -1\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{+81} \lor \neg \left(a \leq 200000000000\right):\\
\;\;\;\;x - \frac{y - z}{\frac{t\_1}{a}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\left(y - z\right) \cdot a}{t\_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.70000000000000001e81 or 2e11 < a

    1. Initial program 99.8%

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

    if -1.70000000000000001e81 < a < 2e11

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - z\right) - -1\\ t_2 := \frac{y - z}{\frac{t\_1}{a}}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+109} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+145}\right):\\ \;\;\;\;\left(y - z\right) \cdot \frac{a}{\left(-1 - t\right) + z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{\left(y - z\right) \cdot a}{t\_1}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- (- t z) -1.0)) (t_2 (/ (- y z) (/ t_1 a))))
   (if (or (<= t_2 -1e+109) (not (<= t_2 2e+145)))
     (* (- y z) (/ a (+ (- -1.0 t) z)))
     (- x (/ (* (- y z) a) t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - z) - -1.0;
	double t_2 = (y - z) / (t_1 / a);
	double tmp;
	if ((t_2 <= -1e+109) || !(t_2 <= 2e+145)) {
		tmp = (y - z) * (a / ((-1.0 - t) + z));
	} else {
		tmp = x - (((y - z) * a) / t_1);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (t - z) - (-1.0d0)
    t_2 = (y - z) / (t_1 / a)
    if ((t_2 <= (-1d+109)) .or. (.not. (t_2 <= 2d+145))) then
        tmp = (y - z) * (a / (((-1.0d0) - t) + z))
    else
        tmp = x - (((y - z) * a) / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - z) - -1.0;
	double t_2 = (y - z) / (t_1 / a);
	double tmp;
	if ((t_2 <= -1e+109) || !(t_2 <= 2e+145)) {
		tmp = (y - z) * (a / ((-1.0 - t) + z));
	} else {
		tmp = x - (((y - z) * a) / t_1);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (t - z) - -1.0
	t_2 = (y - z) / (t_1 / a)
	tmp = 0
	if (t_2 <= -1e+109) or not (t_2 <= 2e+145):
		tmp = (y - z) * (a / ((-1.0 - t) + z))
	else:
		tmp = x - (((y - z) * a) / t_1)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - z) - -1.0)
	t_2 = Float64(Float64(y - z) / Float64(t_1 / a))
	tmp = 0.0
	if ((t_2 <= -1e+109) || !(t_2 <= 2e+145))
		tmp = Float64(Float64(y - z) * Float64(a / Float64(Float64(-1.0 - t) + z)));
	else
		tmp = Float64(x - Float64(Float64(Float64(y - z) * a) / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (t - z) - -1.0;
	t_2 = (y - z) / (t_1 / a);
	tmp = 0.0;
	if ((t_2 <= -1e+109) || ~((t_2 <= 2e+145)))
		tmp = (y - z) * (a / ((-1.0 - t) + z));
	else
		tmp = x - (((y - z) * a) / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] / N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -1e+109], N[Not[LessEqual[t$95$2, 2e+145]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(a / N[(N[(-1.0 - t), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(y - z), $MachinePrecision] * a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(t - z\right) - -1\\
t_2 := \frac{y - z}{\frac{t\_1}{a}}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+109} \lor \neg \left(t\_2 \leq 2 \cdot 10^{+145}\right):\\
\;\;\;\;\left(y - z\right) \cdot \frac{a}{\left(-1 - t\right) + z}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{\left(y - z\right) \cdot a}{t\_1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < -9.99999999999999982e108 or 2e145 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a))

    1. Initial program 99.7%

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

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

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

      if -9.99999999999999982e108 < (/.f64 (-.f64 y z) (/.f64 (+.f64 (-.f64 t z) #s(literal 1 binary64)) a)) < 2e145

      1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{\left(y - z\right) \cdot a}{\left(t - z\right) - -1}} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification95.4%

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

    Alternative 3: 75.2% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{z}{t - z}, a, x\right)\\ \mathbf{if}\;z \leq -8.8 \cdot 10^{+30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{t}, -a, x\right)\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-38}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (fma (/ z (- t z)) a x)))
       (if (<= z -8.8e+30)
         t_1
         (if (<= z 1.1e-175)
           (fma (/ (- y z) t) (- a) x)
           (if (<= z 2.35e-38) (- x (* y a)) t_1)))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = fma((z / (t - z)), a, x);
    	double tmp;
    	if (z <= -8.8e+30) {
    		tmp = t_1;
    	} else if (z <= 1.1e-175) {
    		tmp = fma(((y - z) / t), -a, x);
    	} else if (z <= 2.35e-38) {
    		tmp = x - (y * a);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	t_1 = fma(Float64(z / Float64(t - z)), a, x)
    	tmp = 0.0
    	if (z <= -8.8e+30)
    		tmp = t_1;
    	elseif (z <= 1.1e-175)
    		tmp = fma(Float64(Float64(y - z) / t), Float64(-a), x);
    	elseif (z <= 2.35e-38)
    		tmp = Float64(x - Float64(y * a));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]}, If[LessEqual[z, -8.8e+30], t$95$1, If[LessEqual[z, 1.1e-175], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * (-a) + x), $MachinePrecision], If[LessEqual[z, 2.35e-38], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(\frac{z}{t - z}, a, x\right)\\
    \mathbf{if}\;z \leq -8.8 \cdot 10^{+30}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 1.1 \cdot 10^{-175}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{y - z}{t}, -a, x\right)\\
    
    \mathbf{elif}\;z \leq 2.35 \cdot 10^{-38}:\\
    \;\;\;\;x - y \cdot a\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -8.7999999999999999e30 or 2.34999999999999999e-38 < z

      1. Initial program 92.6%

        \[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. Applied rewrites86.3%

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

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

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

          if -8.7999999999999999e30 < z < 1.1e-175

          1. Initial program 98.8%

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

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

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

            if 1.1e-175 < z < 2.34999999999999999e-38

            1. Initial program 99.7%

              \[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. Applied rewrites90.5%

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

                \[\leadsto x - y \cdot a \]
              3. Step-by-step derivation
                1. Applied rewrites71.2%

                  \[\leadsto x - y \cdot a \]
              4. Recombined 3 regimes into one program.
              5. Add Preprocessing

              Alternative 4: 76.0% accurate, 0.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{z}{t - z}, a, x\right)\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{+28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-238}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{-38}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (let* ((t_1 (fma (/ z (- t z)) a x)))
                 (if (<= z -2.2e+28)
                   t_1
                   (if (<= z -2.5e-238)
                     (- x (/ (* y a) t))
                     (if (<= z 2.35e-38) (- x (* y a)) t_1)))))
              double code(double x, double y, double z, double t, double a) {
              	double t_1 = fma((z / (t - z)), a, x);
              	double tmp;
              	if (z <= -2.2e+28) {
              		tmp = t_1;
              	} else if (z <= -2.5e-238) {
              		tmp = x - ((y * a) / t);
              	} else if (z <= 2.35e-38) {
              		tmp = x - (y * a);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a)
              	t_1 = fma(Float64(z / Float64(t - z)), a, x)
              	tmp = 0.0
              	if (z <= -2.2e+28)
              		tmp = t_1;
              	elseif (z <= -2.5e-238)
              		tmp = Float64(x - Float64(Float64(y * a) / t));
              	elseif (z <= 2.35e-38)
              		tmp = Float64(x - Float64(y * a));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]}, If[LessEqual[z, -2.2e+28], t$95$1, If[LessEqual[z, -2.5e-238], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.35e-38], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \mathsf{fma}\left(\frac{z}{t - z}, a, x\right)\\
              \mathbf{if}\;z \leq -2.2 \cdot 10^{+28}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;z \leq -2.5 \cdot 10^{-238}:\\
              \;\;\;\;x - \frac{y \cdot a}{t}\\
              
              \mathbf{elif}\;z \leq 2.35 \cdot 10^{-38}:\\
              \;\;\;\;x - y \cdot a\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if z < -2.19999999999999986e28 or 2.34999999999999999e-38 < z

                1. Initial program 92.6%

                  \[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. Applied rewrites86.3%

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

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

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

                    if -2.19999999999999986e28 < z < -2.5e-238

                    1. Initial program 97.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. Applied rewrites85.1%

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

                        \[\leadsto x - \frac{y \cdot a}{t} \]
                      3. Step-by-step derivation
                        1. Applied rewrites85.2%

                          \[\leadsto x - \frac{y \cdot a}{t} \]

                        if -2.5e-238 < z < 2.34999999999999999e-38

                        1. Initial program 99.7%

                          \[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. Applied rewrites96.5%

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

                            \[\leadsto x - y \cdot a \]
                          3. Step-by-step derivation
                            1. Applied rewrites70.1%

                              \[\leadsto x - y \cdot a \]
                          4. Recombined 3 regimes into one program.
                          5. Add Preprocessing

                          Alternative 5: 88.6% accurate, 0.9× speedup?

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

                            1. Initial program 88.4%

                              \[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. Applied rewrites93.3%

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

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

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

                                if -7.5000000000000002e142 < z < 3.99999999999999979e49

                                1. Initial program 99.2%

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

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

                                    \[\leadsto x - \color{blue}{\frac{y}{\left(1 + t\right) - z} \cdot a} \]
                                5. Recombined 2 regimes into one program.
                                6. Final simplification91.9%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+142} \lor \neg \left(z \leq 4 \cdot 10^{+49}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t - z}, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\left(1 + t\right) - z} \cdot a\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 6: 86.6% accurate, 1.0× speedup?

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

                                  1. Initial program 94.4%

                                    \[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. Applied rewrites100.0%

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

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

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

                                      if -7.5000000000000002e142 < z < 2.34999999999999999e-38

                                      1. Initial program 99.2%

                                        \[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. Applied rewrites93.0%

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

                                        if 2.34999999999999999e-38 < z

                                        1. Initial program 89.4%

                                          \[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. Applied rewrites83.0%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z}, a, x\right)} \]
                                        5. Recombined 3 regimes into one program.
                                        6. Add Preprocessing

                                        Alternative 7: 86.1% accurate, 1.0× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+142} \lor \neg \left(z \leq 2.5 \cdot 10^{-38}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t - 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 -7.5e+142) (not (<= z 2.5e-38)))
                                           (fma (/ z (- 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 <= -7.5e+142) || !(z <= 2.5e-38)) {
                                        		tmp = fma((z / (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 <= -7.5e+142) || !(z <= 2.5e-38))
                                        		tmp = fma(Float64(z / Float64(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, -7.5e+142], N[Not[LessEqual[z, 2.5e-38]], $MachinePrecision]], N[(N[(z / N[(t - 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 -7.5 \cdot 10^{+142} \lor \neg \left(z \leq 2.5 \cdot 10^{-38}\right):\\
                                        \;\;\;\;\mathsf{fma}\left(\frac{z}{t - 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 < -7.5000000000000002e142 or 2.50000000000000017e-38 < z

                                          1. Initial program 91.1%

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

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

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

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

                                              if -7.5000000000000002e142 < z < 2.50000000000000017e-38

                                              1. Initial program 99.2%

                                                \[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. Applied rewrites93.0%

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

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+142} \lor \neg \left(z \leq 2.5 \cdot 10^{-38}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t - z}, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{1 + t} \cdot a\\ \end{array} \]
                                              7. Add Preprocessing

                                              Alternative 8: 73.7% accurate, 1.1× speedup?

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

                                                1. Initial program 92.5%

                                                  \[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. Applied rewrites85.4%

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

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

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

                                                    if -3.8000000000000002e-5 < z < 310

                                                    1. Initial program 99.0%

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

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

                                                        \[\leadsto x - y \cdot a \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites72.3%

                                                          \[\leadsto x - y \cdot a \]
                                                      4. Recombined 2 regimes into one program.
                                                      5. Final simplification74.9%

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

                                                      Alternative 9: 72.0% accurate, 1.1× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+31}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-238}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 310:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
                                                      (FPCore (x y z t a)
                                                       :precision binary64
                                                       (if (<= z -3.3e+31)
                                                         (- x a)
                                                         (if (<= z -2.5e-238)
                                                           (- x (/ (* y a) t))
                                                           (if (<= z 310.0) (- x (* y a)) (- x a)))))
                                                      double code(double x, double y, double z, double t, double a) {
                                                      	double tmp;
                                                      	if (z <= -3.3e+31) {
                                                      		tmp = x - a;
                                                      	} else if (z <= -2.5e-238) {
                                                      		tmp = x - ((y * a) / t);
                                                      	} else if (z <= 310.0) {
                                                      		tmp = x - (y * a);
                                                      	} else {
                                                      		tmp = x - a;
                                                      	}
                                                      	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 <= (-3.3d+31)) then
                                                              tmp = x - a
                                                          else if (z <= (-2.5d-238)) then
                                                              tmp = x - ((y * a) / t)
                                                          else if (z <= 310.0d0) then
                                                              tmp = x - (y * a)
                                                          else
                                                              tmp = x - a
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double x, double y, double z, double t, double a) {
                                                      	double tmp;
                                                      	if (z <= -3.3e+31) {
                                                      		tmp = x - a;
                                                      	} else if (z <= -2.5e-238) {
                                                      		tmp = x - ((y * a) / t);
                                                      	} else if (z <= 310.0) {
                                                      		tmp = x - (y * a);
                                                      	} else {
                                                      		tmp = x - a;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(x, y, z, t, a):
                                                      	tmp = 0
                                                      	if z <= -3.3e+31:
                                                      		tmp = x - a
                                                      	elif z <= -2.5e-238:
                                                      		tmp = x - ((y * a) / t)
                                                      	elif z <= 310.0:
                                                      		tmp = x - (y * a)
                                                      	else:
                                                      		tmp = x - a
                                                      	return tmp
                                                      
                                                      function code(x, y, z, t, a)
                                                      	tmp = 0.0
                                                      	if (z <= -3.3e+31)
                                                      		tmp = Float64(x - a);
                                                      	elseif (z <= -2.5e-238)
                                                      		tmp = Float64(x - Float64(Float64(y * a) / t));
                                                      	elseif (z <= 310.0)
                                                      		tmp = Float64(x - Float64(y * a));
                                                      	else
                                                      		tmp = Float64(x - a);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(x, y, z, t, a)
                                                      	tmp = 0.0;
                                                      	if (z <= -3.3e+31)
                                                      		tmp = x - a;
                                                      	elseif (z <= -2.5e-238)
                                                      		tmp = x - ((y * a) / t);
                                                      	elseif (z <= 310.0)
                                                      		tmp = x - (y * a);
                                                      	else
                                                      		tmp = x - a;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e+31], N[(x - a), $MachinePrecision], If[LessEqual[z, -2.5e-238], N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 310.0], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      \mathbf{if}\;z \leq -3.3 \cdot 10^{+31}:\\
                                                      \;\;\;\;x - a\\
                                                      
                                                      \mathbf{elif}\;z \leq -2.5 \cdot 10^{-238}:\\
                                                      \;\;\;\;x - \frac{y \cdot a}{t}\\
                                                      
                                                      \mathbf{elif}\;z \leq 310:\\
                                                      \;\;\;\;x - y \cdot a\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;x - a\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 3 regimes
                                                      2. if z < -3.29999999999999992e31 or 310 < z

                                                        1. Initial program 92.2%

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

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

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

                                                          if -3.29999999999999992e31 < z < -2.5e-238

                                                          1. Initial program 97.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. Applied rewrites85.1%

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

                                                              \[\leadsto x - \frac{y \cdot a}{t} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites85.2%

                                                                \[\leadsto x - \frac{y \cdot a}{t} \]

                                                              if -2.5e-238 < z < 310

                                                              1. Initial program 99.7%

                                                                \[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. Applied rewrites94.9%

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

                                                                  \[\leadsto x - y \cdot a \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites70.5%

                                                                    \[\leadsto x - y \cdot a \]
                                                                4. Recombined 3 regimes into one program.
                                                                5. Add Preprocessing

                                                                Alternative 10: 73.6% accurate, 1.7× speedup?

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

                                                                  1. Initial program 92.5%

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

                                                                    \[\leadsto x - \color{blue}{a} \]
                                                                  4. Step-by-step derivation
                                                                    1. Applied rewrites75.4%

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

                                                                    if -0.165000000000000008 < z < 310

                                                                    1. Initial program 99.0%

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

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

                                                                        \[\leadsto x - y \cdot a \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites72.3%

                                                                          \[\leadsto x - y \cdot a \]
                                                                      4. Recombined 2 regimes into one program.
                                                                      5. Final simplification73.9%

                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.165 \lor \neg \left(z \leq 310\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot a\\ \end{array} \]
                                                                      6. Add Preprocessing

                                                                      Alternative 11: 66.4% accurate, 2.2× speedup?

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

                                                                        1. Initial program 92.6%

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

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

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

                                                                          if -3.7999999999999998e-10 < z < 1350

                                                                          1. Initial program 99.0%

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

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

                                                                              \[\leadsto \color{blue}{x} \]
                                                                          5. Recombined 2 regimes into one program.
                                                                          6. Final simplification67.8%

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

                                                                          Alternative 12: 53.8% accurate, 35.0× speedup?

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

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

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

                                                                              \[\leadsto \color{blue}{x} \]
                                                                            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 2025019 
                                                                            (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))))