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

Percentage Accurate: 97.2% → 99.6%
Time: 4.2s
Alternatives: 13
Speedup: 1.1×

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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 97.2% 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.6% accurate, 1.1× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
    4. sub-divN/A

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

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

      \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
    7. associate--l+N/A

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

      \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
    9. associate-+l-N/A

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

      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
    11. lower--.f6499.6

      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
  4. Applied rewrites99.6%

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

Alternative 2: 91.5% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.5e19 or 4.2000000000000002e105 < t

    1. Initial program 96.8%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
      4. sub-divN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
      7. associate--l+N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
      9. associate-+l-N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
      11. lower--.f6499.2

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
    4. Applied rewrites99.2%

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

      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
      2. lift--.f6486.1

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
    7. Applied rewrites86.1%

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

    if -3.5e19 < t < 4.2000000000000002e105

    1. Initial program 97.4%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
      4. sub-divN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
      7. associate--l+N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
      9. associate-+l-N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
      11. lower--.f6499.9

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

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

      \[\leadsto \mathsf{fma}\left(\frac{z - y}{1 - z}, a, x\right) \]
    6. Step-by-step derivation
      1. lower--.f6495.2

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{1 - z}, a, x\right) \]
    7. Applied rewrites95.2%

      \[\leadsto \mathsf{fma}\left(\frac{z - y}{1 - z}, a, x\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 87.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+49}:\\ \;\;\;\;x - \frac{y - z}{\frac{-z}{a}}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-18}:\\ \;\;\;\;x - a \cdot \frac{y}{1 + t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t - \left(z - 1\right)}, a, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.2e+49)
   (- x (/ (- y z) (/ (- z) a)))
   (if (<= z 6e-18)
     (- x (* a (/ y (+ 1.0 t))))
     (fma (/ z (- t (- z 1.0))) a x))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.2e+49) {
		tmp = x - ((y - z) / (-z / a));
	} else if (z <= 6e-18) {
		tmp = x - (a * (y / (1.0 + t)));
	} else {
		tmp = fma((z / (t - (z - 1.0))), a, x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.2e+49)
		tmp = Float64(x - Float64(Float64(y - z) / Float64(Float64(-z) / a)));
	elseif (z <= 6e-18)
		tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t))));
	else
		tmp = fma(Float64(z / Float64(t - Float64(z - 1.0))), a, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+49], N[(x - N[(N[(y - z), $MachinePrecision] / N[((-z) / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-18], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / N[(t - N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+49}:\\
\;\;\;\;x - \frac{y - z}{\frac{-z}{a}}\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-18}:\\
\;\;\;\;x - a \cdot \frac{y}{1 + t}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t - \left(z - 1\right)}, a, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.20000000000000014e49

    1. Initial program 94.2%

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

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-1 \cdot z}}{a}} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto x - \frac{y - z}{\frac{\mathsf{neg}\left(z\right)}{a}} \]
      2. lower-neg.f6484.2

        \[\leadsto x - \frac{y - z}{\frac{-z}{a}} \]
    4. Applied rewrites84.2%

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

    if -3.20000000000000014e49 < z < 5.99999999999999966e-18

    1. Initial program 99.0%

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

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

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

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

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

        \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
    4. Applied rewrites90.6%

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

    if 5.99999999999999966e-18 < z

    1. Initial program 95.7%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
      4. sub-divN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
      7. associate--l+N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
      9. associate-+l-N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
      11. lower--.f6499.9

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

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

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

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

    Alternative 4: 87.3% accurate, 0.9× speedup?

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

      1. Initial program 94.2%

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

        \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-1 \cdot z}}{a}} \]
      3. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto x - \frac{y - z}{\frac{\mathsf{neg}\left(z\right)}{a}} \]
        2. lower-neg.f6484.2

          \[\leadsto x - \frac{y - z}{\frac{-z}{a}} \]
      4. Applied rewrites84.2%

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

      if -3.20000000000000014e49 < z < 1.6199999999999999e-37

      1. Initial program 99.0%

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

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

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

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

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

          \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
      4. Applied rewrites90.9%

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

      if 1.6199999999999999e-37 < z

      1. Initial program 96.0%

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
        4. sub-divN/A

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

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

          \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
        7. associate--l+N/A

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

          \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
        9. associate-+l-N/A

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

          \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
        11. lower--.f6499.9

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

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

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

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

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

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

        Alternative 5: 86.7% 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 -3.2 \cdot 10^{+49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.62 \cdot 10^{-37}:\\ \;\;\;\;x - a \cdot \frac{y}{1 + t}\\ \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 -3.2e+49)
             t_1
             (if (<= z 1.62e-37) (- x (* a (/ y (+ 1.0 t)))) 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 <= -3.2e+49) {
        		tmp = t_1;
        	} else if (z <= 1.62e-37) {
        		tmp = x - (a * (y / (1.0 + t)));
        	} 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 <= -3.2e+49)
        		tmp = t_1;
        	elseif (z <= 1.62e-37)
        		tmp = Float64(x - Float64(a * Float64(y / Float64(1.0 + t))));
        	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, -3.2e+49], t$95$1, If[LessEqual[z, 1.62e-37], N[(x - N[(a * N[(y / N[(1.0 + t), $MachinePrecision]), $MachinePrecision]), $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 -3.2 \cdot 10^{+49}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;z \leq 1.62 \cdot 10^{-37}:\\
        \;\;\;\;x - a \cdot \frac{y}{1 + t}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -3.20000000000000014e49 or 1.6199999999999999e-37 < z

          1. Initial program 95.2%

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
            4. sub-divN/A

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

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

              \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
            7. associate--l+N/A

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

              \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
            9. associate-+l-N/A

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

              \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
            11. lower--.f6499.9

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

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

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

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

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

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

              if -3.20000000000000014e49 < z < 1.6199999999999999e-37

              1. Initial program 99.0%

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

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

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

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

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

                  \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
              4. Applied rewrites90.9%

                \[\leadsto x - \color{blue}{a \cdot \frac{y}{1 + t}} \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 6: 75.4% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{z}{t - z}, a, x\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-237}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z - y}{t}, a, x\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-115}:\\ \;\;\;\;x - a \cdot y\\ \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 -3.2e+49)
                 t_1
                 (if (<= z -3.3e-237)
                   (fma (/ (- z y) t) a x)
                   (if (<= z 4.6e-115) (- x (* a y)) 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 <= -3.2e+49) {
            		tmp = t_1;
            	} else if (z <= -3.3e-237) {
            		tmp = fma(((z - y) / t), a, x);
            	} else if (z <= 4.6e-115) {
            		tmp = x - (a * y);
            	} 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 <= -3.2e+49)
            		tmp = t_1;
            	elseif (z <= -3.3e-237)
            		tmp = fma(Float64(Float64(z - y) / t), a, x);
            	elseif (z <= 4.6e-115)
            		tmp = Float64(x - Float64(a * y));
            	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, -3.2e+49], t$95$1, If[LessEqual[z, -3.3e-237], N[(N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[z, 4.6e-115], N[(x - N[(a * y), $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 -3.2 \cdot 10^{+49}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;z \leq -3.3 \cdot 10^{-237}:\\
            \;\;\;\;\mathsf{fma}\left(\frac{z - y}{t}, a, x\right)\\
            
            \mathbf{elif}\;z \leq 4.6 \cdot 10^{-115}:\\
            \;\;\;\;x - a \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if z < -3.20000000000000014e49 or 4.59999999999999969e-115 < z

              1. Initial program 95.6%

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
                4. sub-divN/A

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
                7. associate--l+N/A

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

                  \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
                9. associate-+l-N/A

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

                  \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                11. lower--.f6499.8

                  \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
              4. Applied rewrites99.8%

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

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

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

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

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

                  if -3.20000000000000014e49 < z < -3.3000000000000001e-237

                  1. Initial program 99.0%

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
                    4. sub-divN/A

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
                    7. associate--l+N/A

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

                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
                    9. associate-+l-N/A

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

                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                    11. lower--.f6499.5

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                  6. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                    2. lift--.f6465.8

                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                  7. Applied rewrites65.8%

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

                  if -3.3000000000000001e-237 < z < 4.59999999999999969e-115

                  1. Initial program 99.2%

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

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

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

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

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

                      \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
                  4. Applied rewrites96.8%

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

                    \[\leadsto x - a \cdot y \]
                  6. Step-by-step derivation
                    1. Applied rewrites74.7%

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

                  Alternative 7: 72.9% accurate, 0.8× speedup?

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

                    1. Initial program 96.7%

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
                      4. sub-divN/A

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
                      7. associate--l+N/A

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

                        \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
                      9. associate-+l-N/A

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

                        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                      11. lower--.f6499.4

                        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                    4. Applied rewrites99.4%

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

                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                    6. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                      2. lift--.f6477.5

                        \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                    7. Applied rewrites77.5%

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

                    if -3.15e19 < t < -4.00000000000000006e-155

                    1. Initial program 97.6%

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

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

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

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

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

                        \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
                    4. Applied rewrites67.8%

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

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

                        \[\leadsto x - a \cdot y \]

                      if -4.00000000000000006e-155 < t < 3.0000000000000001e-86

                      1. Initial program 97.7%

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
                        4. sub-divN/A

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
                        7. associate--l+N/A

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

                          \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
                        9. associate-+l-N/A

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

                          \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                        11. lower--.f64100.0

                          \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                      4. Applied rewrites100.0%

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

                        \[\leadsto \mathsf{fma}\left(\frac{z - y}{1 - z}, a, x\right) \]
                      6. Step-by-step derivation
                        1. lower--.f64100.0

                          \[\leadsto \mathsf{fma}\left(\frac{z - y}{1 - z}, a, x\right) \]
                      7. Applied rewrites100.0%

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{z}{1 - z}, a, x\right) \]
                      10. Recombined 3 regimes into one program.
                      11. Add Preprocessing

                      Alternative 8: 72.9% accurate, 0.8× speedup?

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

                        1. Initial program 96.7%

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
                          4. sub-divN/A

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
                          7. associate--l+N/A

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

                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
                          9. associate-+l-N/A

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

                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                          11. lower--.f6499.3

                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                        4. Applied rewrites99.3%

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

                          \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                        6. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                          2. lift--.f6481.9

                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                        7. Applied rewrites81.9%

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

                        if -3.15e19 < t < 2.1999999999999999e-155

                        1. Initial program 97.7%

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

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

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

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

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

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

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

                          \[\leadsto x - a \cdot y \]
                        6. Step-by-step derivation
                          1. Applied rewrites66.0%

                            \[\leadsto x - a \cdot y \]

                          if 2.1999999999999999e-155 < t < 1.94999999999999998e-19

                          1. Initial program 97.3%

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

                            \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-1 \cdot z}}{a}} \]
                          3. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto x - \frac{y - z}{\frac{\mathsf{neg}\left(z\right)}{a}} \]
                            2. lower-neg.f6463.0

                              \[\leadsto x - \frac{y - z}{\frac{-z}{a}} \]
                          4. Applied rewrites63.0%

                            \[\leadsto x - \frac{y - z}{\frac{\color{blue}{-z}}{a}} \]
                          5. Taylor expanded in y around inf

                            \[\leadsto x - \frac{\color{blue}{y}}{\frac{-z}{a}} \]
                          6. Step-by-step derivation
                            1. Applied rewrites46.6%

                              \[\leadsto x - \frac{\color{blue}{y}}{\frac{-z}{a}} \]
                            2. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto x - \color{blue}{\frac{y}{\frac{-z}{a}}} \]
                              2. lift-/.f64N/A

                                \[\leadsto x - \frac{y}{\color{blue}{\frac{-z}{a}}} \]
                              3. associate-/r/N/A

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

                                \[\leadsto x - \color{blue}{\frac{y}{-z} \cdot a} \]
                              5. lower-/.f6447.3

                                \[\leadsto x - \color{blue}{\frac{y}{-z}} \cdot a \]
                              6. associate-+l-47.3

                                \[\leadsto x - \frac{y}{-\color{blue}{z}} \cdot a \]
                            3. Applied rewrites47.3%

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

                          Alternative 9: 72.0% accurate, 0.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+49}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-260}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-18}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+118}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, a, x\right)\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (if (<= z -3.2e+49)
                             (- x a)
                             (if (<= z -7.2e-260)
                               (- x (* a (/ y t)))
                               (if (<= z 5e-18)
                                 (- x (* a y))
                                 (if (<= z 3.2e+118) (fma (/ z t) a x) (- x a))))))
                          double code(double x, double y, double z, double t, double a) {
                          	double tmp;
                          	if (z <= -3.2e+49) {
                          		tmp = x - a;
                          	} else if (z <= -7.2e-260) {
                          		tmp = x - (a * (y / t));
                          	} else if (z <= 5e-18) {
                          		tmp = x - (a * y);
                          	} else if (z <= 3.2e+118) {
                          		tmp = fma((z / t), a, x);
                          	} else {
                          		tmp = x - a;
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t, a)
                          	tmp = 0.0
                          	if (z <= -3.2e+49)
                          		tmp = Float64(x - a);
                          	elseif (z <= -7.2e-260)
                          		tmp = Float64(x - Float64(a * Float64(y / t)));
                          	elseif (z <= 5e-18)
                          		tmp = Float64(x - Float64(a * y));
                          	elseif (z <= 3.2e+118)
                          		tmp = fma(Float64(z / t), a, x);
                          	else
                          		tmp = Float64(x - a);
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+49], N[(x - a), $MachinePrecision], If[LessEqual[z, -7.2e-260], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-18], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+118], N[(N[(z / t), $MachinePrecision] * a + x), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;z \leq -3.2 \cdot 10^{+49}:\\
                          \;\;\;\;x - a\\
                          
                          \mathbf{elif}\;z \leq -7.2 \cdot 10^{-260}:\\
                          \;\;\;\;x - a \cdot \frac{y}{t}\\
                          
                          \mathbf{elif}\;z \leq 5 \cdot 10^{-18}:\\
                          \;\;\;\;x - a \cdot y\\
                          
                          \mathbf{elif}\;z \leq 3.2 \cdot 10^{+118}:\\
                          \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, a, x\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;x - a\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if z < -3.20000000000000014e49 or 3.20000000000000016e118 < z

                            1. Initial program 94.2%

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

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

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

                              if -3.20000000000000014e49 < z < -7.2000000000000002e-260

                              1. Initial program 99.0%

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

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

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

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

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

                                  \[\leadsto x - a \cdot \frac{y}{1 + \color{blue}{t}} \]
                              4. Applied rewrites87.7%

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

                                \[\leadsto x - a \cdot \frac{y}{t} \]
                              6. Step-by-step derivation
                                1. Applied rewrites64.4%

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

                                if -7.2000000000000002e-260 < z < 5.00000000000000036e-18

                                1. Initial program 99.0%

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

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

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

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

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

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

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

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

                                    \[\leadsto x - a \cdot y \]

                                  if 5.00000000000000036e-18 < z < 3.20000000000000016e118

                                  1. Initial program 98.1%

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
                                    4. sub-divN/A

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
                                    7. associate--l+N/A

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

                                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
                                    9. associate-+l-N/A

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

                                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                                    11. lower--.f6499.9

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                                  6. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                                    2. lift--.f6454.7

                                      \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                                  7. Applied rewrites54.7%

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{z}{t}, a, x\right) \]
                                  10. Recombined 4 regimes into one program.
                                  11. Add Preprocessing

                                  Alternative 10: 71.9% accurate, 0.9× speedup?

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

                                    1. Initial program 94.5%

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

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

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

                                      if -2.85e7 < z < 5.00000000000000036e-18

                                      1. Initial program 99.0%

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

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

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

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

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

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

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

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

                                          \[\leadsto x - a \cdot y \]

                                        if 5.00000000000000036e-18 < z < 3.20000000000000016e118

                                        1. Initial program 98.1%

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{z}{\left(1 + t\right) - z} - \frac{y}{\left(1 + t\right) - z}, \color{blue}{a}, x\right) \]
                                          4. sub-divN/A

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(1 + t\right) - z}, a, x\right) \]
                                          7. associate--l+N/A

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

                                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{\left(t - z\right) + 1}, a, x\right) \]
                                          9. associate-+l-N/A

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

                                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{t - \left(z - 1\right)}, a, x\right) \]
                                          11. lower--.f6499.9

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                                        6. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                                          2. lift--.f6454.7

                                            \[\leadsto \mathsf{fma}\left(\frac{z - y}{t}, a, x\right) \]
                                        7. Applied rewrites54.7%

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{z}{t}, a, x\right) \]
                                        10. Recombined 3 regimes into one program.
                                        11. Add Preprocessing

                                        Alternative 11: 70.8% accurate, 1.3× speedup?

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

                                          1. Initial program 94.8%

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

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

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

                                            if -2.85e7 < z < 6.40000000000000022e63

                                            1. Initial program 99.0%

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

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

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

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

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

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

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

                                              \[\leadsto x - a \cdot y \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites68.9%

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

                                            Alternative 12: 65.7% accurate, 1.6× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -49000000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a)
                                             :precision binary64
                                             (if (<= z -49000000.0) (- x a) (if (<= z 7.5e+63) x (- x a))))
                                            double code(double x, double y, double z, double t, double a) {
                                            	double tmp;
                                            	if (z <= -49000000.0) {
                                            		tmp = x - a;
                                            	} else if (z <= 7.5e+63) {
                                            		tmp = x;
                                            	} 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 <= (-49000000.0d0)) then
                                                    tmp = x - a
                                                else if (z <= 7.5d+63) then
                                                    tmp = x
                                                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 <= -49000000.0) {
                                            		tmp = x - a;
                                            	} else if (z <= 7.5e+63) {
                                            		tmp = x;
                                            	} else {
                                            		tmp = x - a;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(x, y, z, t, a):
                                            	tmp = 0
                                            	if z <= -49000000.0:
                                            		tmp = x - a
                                            	elif z <= 7.5e+63:
                                            		tmp = x
                                            	else:
                                            		tmp = x - a
                                            	return tmp
                                            
                                            function code(x, y, z, t, a)
                                            	tmp = 0.0
                                            	if (z <= -49000000.0)
                                            		tmp = Float64(x - a);
                                            	elseif (z <= 7.5e+63)
                                            		tmp = x;
                                            	else
                                            		tmp = Float64(x - a);
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(x, y, z, t, a)
                                            	tmp = 0.0;
                                            	if (z <= -49000000.0)
                                            		tmp = x - a;
                                            	elseif (z <= 7.5e+63)
                                            		tmp = x;
                                            	else
                                            		tmp = x - a;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[x_, y_, z_, t_, a_] := If[LessEqual[z, -49000000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, 7.5e+63], x, N[(x - a), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;z \leq -49000000:\\
                                            \;\;\;\;x - a\\
                                            
                                            \mathbf{elif}\;z \leq 7.5 \cdot 10^{+63}:\\
                                            \;\;\;\;x\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;x - a\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if z < -4.9e7 or 7.5000000000000005e63 < z

                                              1. Initial program 94.8%

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

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

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

                                                if -4.9e7 < z < 7.5000000000000005e63

                                                1. Initial program 99.0%

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

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

                                                    \[\leadsto \color{blue}{x} \]
                                                4. Recombined 2 regimes into one program.
                                                5. Add Preprocessing

                                                Alternative 13: 53.7% accurate, 18.3× 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 97.2%

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

                                                  \[\leadsto \color{blue}{x} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites53.7%

                                                    \[\leadsto \color{blue}{x} \]
                                                  2. Add Preprocessing

                                                  Reproduce

                                                  ?
                                                  herbie shell --seed 2025120 
                                                  (FPCore (x y z t a)
                                                    :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
                                                    :precision binary64
                                                    (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))