Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A

Percentage Accurate: 98.4% → 98.4%
Time: 9.0s
Alternatives: 17
Speedup: 1.0×

Specification

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

\\
x + y \cdot \frac{z - t}{z - 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 17 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: 98.4% accurate, 1.0× speedup?

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

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}

Alternative 1: 98.4% accurate, 1.0× speedup?

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

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Derivation
  1. Initial program 98.4%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing

Alternative 2: 96.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -10:\\
\;\;\;\;x + y \cdot \frac{-t}{z - a}\\

\mathbf{elif}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -10

    1. Initial program 96.3%

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

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

        \[\leadsto x + y \cdot \frac{\mathsf{neg}\left(t\right)}{z - a} \]
      2. lower-neg.f6495.5

        \[\leadsto x + y \cdot \frac{-t}{z - a} \]
    4. Applied rewrites95.5%

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

    if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15

    1. Initial program 99.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around inf

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
      8. lift--.f6491.1

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

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

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

    if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2

    1. Initial program 100.0%

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

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

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

        \[\leadsto y \cdot \frac{z - t}{z} + x \]
      3. *-commutativeN/A

        \[\leadsto \frac{z - t}{z} \cdot y + x \]
      4. lower-fma.f64N/A

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

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

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

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

    if 2 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 95.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{\left(z - t\right)} \cdot y}{z - a} \]
      10. lift--.f6490.5

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

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

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

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

        \[\leadsto x + \frac{\left(-t\right) \cdot y}{z - a} \]
    6. Applied rewrites90.0%

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

Alternative 3: 96.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + y \cdot \frac{-t}{z - a}\\
\mathbf{if}\;t\_1 \leq -10:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - z}{a}, y, x\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -10 or 2 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 95.8%

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

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

        \[\leadsto x + y \cdot \frac{\mathsf{neg}\left(t\right)}{z - a} \]
      2. lower-neg.f6494.9

        \[\leadsto x + y \cdot \frac{-t}{z - a} \]
    4. Applied rewrites94.9%

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

    if -10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15

    1. Initial program 99.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around inf

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
      8. lift--.f6491.1

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

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

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

    if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2

    1. Initial program 100.0%

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

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

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

        \[\leadsto y \cdot \frac{z - t}{z} + x \]
      3. *-commutativeN/A

        \[\leadsto \frac{z - t}{z} \cdot y + x \]
      4. lower-fma.f64N/A

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

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

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

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

Alternative 4: 87.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{z}, y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15

    1. Initial program 98.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around inf

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
      8. lift--.f6480.4

        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
    4. Applied rewrites80.4%

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

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

    if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

    1. Initial program 99.9%

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

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

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

        \[\leadsto y \cdot \frac{z - t}{z} + x \]
      3. *-commutativeN/A

        \[\leadsto \frac{z - t}{z} \cdot y + x \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z - t}{z}, y, x\right) \]
      6. lift--.f6493.3

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

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

    if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 93.5%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around inf

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

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot y}{z - a}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{y}{z - a}\right) \]
      3. distribute-lft-neg-inN/A

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

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

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

        \[\leadsto \left(-t\right) \cdot \frac{y}{\color{blue}{z - a}} \]
      7. lift--.f6473.7

        \[\leadsto \left(-t\right) \cdot \frac{y}{z - \color{blue}{a}} \]
    4. Applied rewrites73.7%

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

Alternative 5: 87.1% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000000000001e-15

    1. Initial program 98.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in a around inf

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
      8. lift--.f6480.4

        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
    4. Applied rewrites80.4%

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

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

    if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

    1. Initial program 99.9%

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

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

        \[\leadsto \frac{y \cdot z}{z - a} + \color{blue}{x} \]
      2. associate-/l*N/A

        \[\leadsto y \cdot \frac{z}{z - a} + x \]
      3. *-commutativeN/A

        \[\leadsto \frac{z}{z - a} \cdot y + x \]
      4. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{z - a}, y, x\right) \]
      6. lift--.f6492.6

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

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

    if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 93.5%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around inf

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

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot y}{z - a}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{y}{z - a}\right) \]
      3. distribute-lft-neg-inN/A

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

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

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

        \[\leadsto \left(-t\right) \cdot \frac{y}{\color{blue}{z - a}} \]
      7. lift--.f6473.7

        \[\leadsto \left(-t\right) \cdot \frac{y}{z - \color{blue}{a}} \]
    4. Applied rewrites73.7%

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

Alternative 6: 82.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219

    1. Initial program 97.9%

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

      \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
    3. Step-by-step derivation
      1. lower-/.f6475.1

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

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

    if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

    1. Initial program 99.9%

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

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

        \[\leadsto \frac{y \cdot z}{z - a} + \color{blue}{x} \]
      2. associate-/l*N/A

        \[\leadsto y \cdot \frac{z}{z - a} + x \]
      3. *-commutativeN/A

        \[\leadsto \frac{z}{z - a} \cdot y + x \]
      4. lower-fma.f64N/A

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

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

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

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

    if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 93.5%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in t around inf

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

        \[\leadsto \mathsf{neg}\left(\frac{t \cdot y}{z - a}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(t \cdot \frac{y}{z - a}\right) \]
      3. distribute-lft-neg-inN/A

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

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

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

        \[\leadsto \left(-t\right) \cdot \frac{y}{\color{blue}{z - a}} \]
      7. lift--.f6473.7

        \[\leadsto \left(-t\right) \cdot \frac{y}{z - \color{blue}{a}} \]
    4. Applied rewrites73.7%

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

Alternative 7: 82.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \frac{y}{z - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;t\_1 \leq 0.9995:\\
\;\;\;\;\mathsf{fma}\left(z, t\_2, x\right)\\

\mathbf{elif}\;t\_1 \leq 10^{+63}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219

    1. Initial program 97.9%

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

      \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
    3. Step-by-step derivation
      1. lower-/.f6475.1

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

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

    if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.99950000000000006

    1. Initial program 99.8%

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

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

        \[\leadsto \frac{y \cdot z}{z - a} + \color{blue}{x} \]
      2. associate-/l*N/A

        \[\leadsto y \cdot \frac{z}{z - a} + x \]
      3. *-commutativeN/A

        \[\leadsto \frac{z}{z - a} \cdot y + x \]
      4. lower-fma.f64N/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{z - a}, y, x\right) \]
      2. lift-/.f64N/A

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

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

        \[\leadsto \frac{z \cdot y}{z - a} + x \]
      5. associate-/l*N/A

        \[\leadsto z \cdot \frac{y}{z - a} + x \]
      6. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(z, \frac{y}{\color{blue}{z - a}}, x\right) \]
      8. lift--.f6479.3

        \[\leadsto \mathsf{fma}\left(z, \frac{y}{z - \color{blue}{a}}, x\right) \]
    6. Applied rewrites79.3%

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

    if 0.99950000000000006 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

    1. Initial program 100.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Taylor expanded in z around inf

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

        \[\leadsto x + \color{blue}{y} \]

      if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

      1. Initial program 93.5%

        \[x + y \cdot \frac{z - t}{z - a} \]
      2. Taylor expanded in t around inf

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

          \[\leadsto \mathsf{neg}\left(\frac{t \cdot y}{z - a}\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{neg}\left(t \cdot \frac{y}{z - a}\right) \]
        3. distribute-lft-neg-inN/A

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

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

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

          \[\leadsto \left(-t\right) \cdot \frac{y}{\color{blue}{z - a}} \]
        7. lift--.f6473.7

          \[\leadsto \left(-t\right) \cdot \frac{y}{z - \color{blue}{a}} \]
      4. Applied rewrites73.7%

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

    Alternative 8: 81.7% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-28}:\\ \;\;\;\;x - \frac{y}{a} \cdot z\\ \mathbf{elif}\;t\_1 \leq 10^{+63}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \frac{y}{z - a}\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ (- z t) (- z a))))
       (if (<= t_1 2e-219)
         (+ x (* y (/ t a)))
         (if (<= t_1 2e-28)
           (- x (* (/ y a) z))
           (if (<= t_1 1e+63) (+ x y) (* (- t) (/ y (- z a))))))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = (z - t) / (z - a);
    	double tmp;
    	if (t_1 <= 2e-219) {
    		tmp = x + (y * (t / a));
    	} else if (t_1 <= 2e-28) {
    		tmp = x - ((y / a) * z);
    	} else if (t_1 <= 1e+63) {
    		tmp = x + y;
    	} else {
    		tmp = -t * (y / (z - 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) :: t_1
        real(8) :: tmp
        t_1 = (z - t) / (z - a)
        if (t_1 <= 2d-219) then
            tmp = x + (y * (t / a))
        else if (t_1 <= 2d-28) then
            tmp = x - ((y / a) * z)
        else if (t_1 <= 1d+63) then
            tmp = x + y
        else
            tmp = -t * (y / (z - a))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a) {
    	double t_1 = (z - t) / (z - a);
    	double tmp;
    	if (t_1 <= 2e-219) {
    		tmp = x + (y * (t / a));
    	} else if (t_1 <= 2e-28) {
    		tmp = x - ((y / a) * z);
    	} else if (t_1 <= 1e+63) {
    		tmp = x + y;
    	} else {
    		tmp = -t * (y / (z - a));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = (z - t) / (z - a)
    	tmp = 0
    	if t_1 <= 2e-219:
    		tmp = x + (y * (t / a))
    	elif t_1 <= 2e-28:
    		tmp = x - ((y / a) * z)
    	elif t_1 <= 1e+63:
    		tmp = x + y
    	else:
    		tmp = -t * (y / (z - a))
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(z - t) / Float64(z - a))
    	tmp = 0.0
    	if (t_1 <= 2e-219)
    		tmp = Float64(x + Float64(y * Float64(t / a)));
    	elseif (t_1 <= 2e-28)
    		tmp = Float64(x - Float64(Float64(y / a) * z));
    	elseif (t_1 <= 1e+63)
    		tmp = Float64(x + y);
    	else
    		tmp = Float64(Float64(-t) * Float64(y / Float64(z - a)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = (z - t) / (z - a);
    	tmp = 0.0;
    	if (t_1 <= 2e-219)
    		tmp = x + (y * (t / a));
    	elseif (t_1 <= 2e-28)
    		tmp = x - ((y / a) * z);
    	elseif (t_1 <= 1e+63)
    		tmp = x + y;
    	else
    		tmp = -t * (y / (z - a));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-219], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-28], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], N[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{z - t}{z - a}\\
    \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-219}:\\
    \;\;\;\;x + y \cdot \frac{t}{a}\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-28}:\\
    \;\;\;\;x - \frac{y}{a} \cdot z\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+63}:\\
    \;\;\;\;x + y\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(-t\right) \cdot \frac{y}{z - a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-219

      1. Initial program 97.9%

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

        \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
      3. Step-by-step derivation
        1. lower-/.f6475.1

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

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

      if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999994e-28

      1. Initial program 99.9%

        \[x + y \cdot \frac{z - t}{z - a} \]
      2. Taylor expanded in a around inf

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

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

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

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

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

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

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

          \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
        8. lift--.f6488.9

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

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

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

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

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

          \[\leadsto x - \frac{y}{a} \cdot z \]
      7. Applied rewrites80.5%

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

      if 1.99999999999999994e-28 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

      1. Initial program 99.9%

        \[x + y \cdot \frac{z - t}{z - a} \]
      2. Taylor expanded in z around inf

        \[\leadsto x + \color{blue}{y} \]
      3. Step-by-step derivation
        1. Applied rewrites90.5%

          \[\leadsto x + \color{blue}{y} \]

        if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

        1. Initial program 93.5%

          \[x + y \cdot \frac{z - t}{z - a} \]
        2. Taylor expanded in t around inf

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

            \[\leadsto \mathsf{neg}\left(\frac{t \cdot y}{z - a}\right) \]
          2. associate-/l*N/A

            \[\leadsto \mathsf{neg}\left(t \cdot \frac{y}{z - a}\right) \]
          3. distribute-lft-neg-inN/A

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

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

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

            \[\leadsto \left(-t\right) \cdot \frac{y}{\color{blue}{z - a}} \]
          7. lift--.f6473.7

            \[\leadsto \left(-t\right) \cdot \frac{y}{z - \color{blue}{a}} \]
        4. Applied rewrites73.7%

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

      Alternative 9: 81.0% accurate, 0.3× speedup?

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

        1. Initial program 97.9%

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

          \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
        3. Step-by-step derivation
          1. lower-/.f6475.1

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

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

        if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999994e-28

        1. Initial program 99.9%

          \[x + y \cdot \frac{z - t}{z - a} \]
        2. Taylor expanded in a around inf

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

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

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

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

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

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

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

            \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
          8. lift--.f6488.9

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

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

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

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

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

            \[\leadsto x - \frac{y}{a} \cdot z \]
        7. Applied rewrites80.5%

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

        if 1.99999999999999994e-28 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

        1. Initial program 99.9%

          \[x + y \cdot \frac{z - t}{z - a} \]
        2. Taylor expanded in z around inf

          \[\leadsto x + \color{blue}{y} \]
        3. Step-by-step derivation
          1. Applied rewrites90.5%

            \[\leadsto x + \color{blue}{y} \]

          if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

          1. Initial program 93.5%

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

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

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

              \[\leadsto t \cdot \frac{y}{a} + x \]
            3. *-commutativeN/A

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

              \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{t}, x\right) \]
            5. lower-/.f6463.6

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

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

        Alternative 10: 81.0% accurate, 0.3× speedup?

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

          1. Initial program 97.9%

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

            \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
          3. Step-by-step derivation
            1. lower-/.f6475.1

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

            \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
          5. Step-by-step derivation
            1. lift-+.f64N/A

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t}{a}, y, x\right)} \]
          6. Applied rewrites75.1%

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

          if 2.0000000000000001e-219 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999994e-28

          1. Initial program 99.9%

            \[x + y \cdot \frac{z - t}{z - a} \]
          2. Taylor expanded in a around inf

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

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

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

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

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

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

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

              \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
            8. lift--.f6488.9

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

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

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

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

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

              \[\leadsto x - \frac{y}{a} \cdot z \]
          7. Applied rewrites80.5%

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

          if 1.99999999999999994e-28 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

          1. Initial program 99.9%

            \[x + y \cdot \frac{z - t}{z - a} \]
          2. Taylor expanded in z around inf

            \[\leadsto x + \color{blue}{y} \]
          3. Step-by-step derivation
            1. Applied rewrites90.5%

              \[\leadsto x + \color{blue}{y} \]

            if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

            1. Initial program 93.5%

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

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

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

                \[\leadsto t \cdot \frac{y}{a} + x \]
              3. *-commutativeN/A

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

                \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{t}, x\right) \]
              5. lower-/.f6463.6

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

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

          Alternative 11: 80.5% accurate, 0.4× speedup?

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

            1. Initial program 98.3%

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

              \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
            3. Step-by-step derivation
              1. lower-/.f6476.8

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

              \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]
            5. Step-by-step derivation
              1. lift-+.f64N/A

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

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

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

                \[\leadsto \color{blue}{\frac{t}{a} \cdot y} + x \]
              5. lower-fma.f6476.8

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t}{a}, y, x\right)} \]
            6. Applied rewrites76.8%

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

            if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

            1. Initial program 99.9%

              \[x + y \cdot \frac{z - t}{z - a} \]
            2. Taylor expanded in z around inf

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

                \[\leadsto x + \color{blue}{y} \]

              if 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

              1. Initial program 93.5%

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

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

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

                  \[\leadsto t \cdot \frac{y}{a} + x \]
                3. *-commutativeN/A

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

                  \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{t}, x\right) \]
                5. lower-/.f6463.6

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

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

            Alternative 12: 80.5% accurate, 0.4× speedup?

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

              1. Initial program 97.4%

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

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

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

                  \[\leadsto t \cdot \frac{y}{a} + x \]
                3. *-commutativeN/A

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

                  \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{t}, x\right) \]
                5. lower-/.f6474.4

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

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

              if 1.0000000000000001e-15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

              1. Initial program 99.9%

                \[x + y \cdot \frac{z - t}{z - a} \]
              2. Taylor expanded in z around inf

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

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

              Alternative 13: 71.8% accurate, 0.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := t \cdot \frac{y}{a}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+38}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-124}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 10^{+63}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
              (FPCore (x y z t a)
               :precision binary64
               (let* ((t_1 (/ (- z t) (- z a))) (t_2 (* t (/ y a))))
                 (if (<= t_1 -1e+38)
                   t_2
                   (if (<= t_1 5e-124) x (if (<= t_1 1e+63) (+ x y) t_2)))))
              double code(double x, double y, double z, double t, double a) {
              	double t_1 = (z - t) / (z - a);
              	double t_2 = t * (y / a);
              	double tmp;
              	if (t_1 <= -1e+38) {
              		tmp = t_2;
              	} else if (t_1 <= 5e-124) {
              		tmp = x;
              	} else if (t_1 <= 1e+63) {
              		tmp = x + y;
              	} else {
              		tmp = t_2;
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, y, z, t, a)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8), intent (in) :: a
                  real(8) :: t_1
                  real(8) :: t_2
                  real(8) :: tmp
                  t_1 = (z - t) / (z - a)
                  t_2 = t * (y / a)
                  if (t_1 <= (-1d+38)) then
                      tmp = t_2
                  else if (t_1 <= 5d-124) then
                      tmp = x
                  else if (t_1 <= 1d+63) then
                      tmp = x + y
                  else
                      tmp = t_2
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t, double a) {
              	double t_1 = (z - t) / (z - a);
              	double t_2 = t * (y / a);
              	double tmp;
              	if (t_1 <= -1e+38) {
              		tmp = t_2;
              	} else if (t_1 <= 5e-124) {
              		tmp = x;
              	} else if (t_1 <= 1e+63) {
              		tmp = x + y;
              	} else {
              		tmp = t_2;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t, a):
              	t_1 = (z - t) / (z - a)
              	t_2 = t * (y / a)
              	tmp = 0
              	if t_1 <= -1e+38:
              		tmp = t_2
              	elif t_1 <= 5e-124:
              		tmp = x
              	elif t_1 <= 1e+63:
              		tmp = x + y
              	else:
              		tmp = t_2
              	return tmp
              
              function code(x, y, z, t, a)
              	t_1 = Float64(Float64(z - t) / Float64(z - a))
              	t_2 = Float64(t * Float64(y / a))
              	tmp = 0.0
              	if (t_1 <= -1e+38)
              		tmp = t_2;
              	elseif (t_1 <= 5e-124)
              		tmp = x;
              	elseif (t_1 <= 1e+63)
              		tmp = Float64(x + y);
              	else
              		tmp = t_2;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t, a)
              	t_1 = (z - t) / (z - a);
              	t_2 = t * (y / a);
              	tmp = 0.0;
              	if (t_1 <= -1e+38)
              		tmp = t_2;
              	elseif (t_1 <= 5e-124)
              		tmp = x;
              	elseif (t_1 <= 1e+63)
              		tmp = x + y;
              	else
              		tmp = t_2;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+38], t$95$2, If[LessEqual[t$95$1, 5e-124], x, If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], t$95$2]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \frac{z - t}{z - a}\\
              t_2 := t \cdot \frac{y}{a}\\
              \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+38}:\\
              \;\;\;\;t\_2\\
              
              \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-124}:\\
              \;\;\;\;x\\
              
              \mathbf{elif}\;t\_1 \leq 10^{+63}:\\
              \;\;\;\;x + y\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_2\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999977e37 or 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

                1. Initial program 94.6%

                  \[x + y \cdot \frac{z - t}{z - a} \]
                2. Step-by-step derivation
                  1. lift-*.f64N/A

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

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

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

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

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

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

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

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

                    \[\leadsto x + \frac{\color{blue}{\left(z - t\right)} \cdot y}{z - a} \]
                  10. lift--.f6493.6

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

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

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

                    \[\leadsto x + \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot y}{z - a} \]
                  2. lower-neg.f6493.6

                    \[\leadsto x + \frac{\left(-t\right) \cdot y}{z - a} \]
                6. Applied rewrites93.6%

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

                  \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
                8. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto -1 \cdot \frac{t \cdot y}{z - a} \]
                  2. associate-/l*N/A

                    \[\leadsto -1 \cdot \frac{t \cdot y}{z - a} \]
                  3. associate-*r/N/A

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

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

                    \[\leadsto \frac{\left(-1 \cdot t\right) \cdot y}{\color{blue}{z} - a} \]
                  6. mul-1-negN/A

                    \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot y}{z - a} \]
                  7. lift-neg.f64N/A

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

                    \[\leadsto \frac{\left(-t\right) \cdot y}{\color{blue}{z} - a} \]
                  9. lift--.f6469.8

                    \[\leadsto \frac{\left(-t\right) \cdot y}{z - \color{blue}{a}} \]
                9. Applied rewrites69.8%

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

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

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

                    \[\leadsto t \cdot \frac{y}{\color{blue}{a}} \]
                  3. lower-/.f6446.5

                    \[\leadsto t \cdot \frac{y}{a} \]
                12. Applied rewrites46.5%

                  \[\leadsto t \cdot \color{blue}{\frac{y}{a}} \]

                if -9.99999999999999977e37 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000003e-124

                1. Initial program 99.3%

                  \[x + y \cdot \frac{z - t}{z - a} \]
                2. Taylor expanded in x around inf

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

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

                  if 5.0000000000000003e-124 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

                  1. Initial program 99.9%

                    \[x + y \cdot \frac{z - t}{z - a} \]
                  2. Taylor expanded in z around inf

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

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

                  Alternative 14: 71.3% accurate, 0.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := \frac{y \cdot t}{a}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+38}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-124}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 10^{+63}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                  (FPCore (x y z t a)
                   :precision binary64
                   (let* ((t_1 (/ (- z t) (- z a))) (t_2 (/ (* y t) a)))
                     (if (<= t_1 -1e+38)
                       t_2
                       (if (<= t_1 5e-124) x (if (<= t_1 1e+63) (+ x y) t_2)))))
                  double code(double x, double y, double z, double t, double a) {
                  	double t_1 = (z - t) / (z - a);
                  	double t_2 = (y * t) / a;
                  	double tmp;
                  	if (t_1 <= -1e+38) {
                  		tmp = t_2;
                  	} else if (t_1 <= 5e-124) {
                  		tmp = x;
                  	} else if (t_1 <= 1e+63) {
                  		tmp = x + y;
                  	} else {
                  		tmp = t_2;
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z, t, a)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8), intent (in) :: a
                      real(8) :: t_1
                      real(8) :: t_2
                      real(8) :: tmp
                      t_1 = (z - t) / (z - a)
                      t_2 = (y * t) / a
                      if (t_1 <= (-1d+38)) then
                          tmp = t_2
                      else if (t_1 <= 5d-124) then
                          tmp = x
                      else if (t_1 <= 1d+63) then
                          tmp = x + y
                      else
                          tmp = t_2
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a) {
                  	double t_1 = (z - t) / (z - a);
                  	double t_2 = (y * t) / a;
                  	double tmp;
                  	if (t_1 <= -1e+38) {
                  		tmp = t_2;
                  	} else if (t_1 <= 5e-124) {
                  		tmp = x;
                  	} else if (t_1 <= 1e+63) {
                  		tmp = x + y;
                  	} else {
                  		tmp = t_2;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a):
                  	t_1 = (z - t) / (z - a)
                  	t_2 = (y * t) / a
                  	tmp = 0
                  	if t_1 <= -1e+38:
                  		tmp = t_2
                  	elif t_1 <= 5e-124:
                  		tmp = x
                  	elif t_1 <= 1e+63:
                  		tmp = x + y
                  	else:
                  		tmp = t_2
                  	return tmp
                  
                  function code(x, y, z, t, a)
                  	t_1 = Float64(Float64(z - t) / Float64(z - a))
                  	t_2 = Float64(Float64(y * t) / a)
                  	tmp = 0.0
                  	if (t_1 <= -1e+38)
                  		tmp = t_2;
                  	elseif (t_1 <= 5e-124)
                  		tmp = x;
                  	elseif (t_1 <= 1e+63)
                  		tmp = Float64(x + y);
                  	else
                  		tmp = t_2;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a)
                  	t_1 = (z - t) / (z - a);
                  	t_2 = (y * t) / a;
                  	tmp = 0.0;
                  	if (t_1 <= -1e+38)
                  		tmp = t_2;
                  	elseif (t_1 <= 5e-124)
                  		tmp = x;
                  	elseif (t_1 <= 1e+63)
                  		tmp = x + y;
                  	else
                  		tmp = t_2;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+38], t$95$2, If[LessEqual[t$95$1, 5e-124], x, If[LessEqual[t$95$1, 1e+63], N[(x + y), $MachinePrecision], t$95$2]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := \frac{z - t}{z - a}\\
                  t_2 := \frac{y \cdot t}{a}\\
                  \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+38}:\\
                  \;\;\;\;t\_2\\
                  
                  \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-124}:\\
                  \;\;\;\;x\\
                  
                  \mathbf{elif}\;t\_1 \leq 10^{+63}:\\
                  \;\;\;\;x + y\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_2\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999977e37 or 1.00000000000000006e63 < (/.f64 (-.f64 z t) (-.f64 z a))

                    1. Initial program 94.6%

                      \[x + y \cdot \frac{z - t}{z - a} \]
                    2. Taylor expanded in a around inf

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

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

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

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

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

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

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

                        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
                      8. lift--.f6461.7

                        \[\leadsto x - \frac{\left(z - t\right) \cdot y}{a} \]
                    4. Applied rewrites61.7%

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

                      \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
                    6. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \frac{t \cdot y}{a} \]
                      2. *-commutativeN/A

                        \[\leadsto \frac{y \cdot t}{a} \]
                      3. lower-*.f6444.7

                        \[\leadsto \frac{y \cdot t}{a} \]
                    7. Applied rewrites44.7%

                      \[\leadsto \frac{y \cdot t}{\color{blue}{a}} \]

                    if -9.99999999999999977e37 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000003e-124

                    1. Initial program 99.3%

                      \[x + y \cdot \frac{z - t}{z - a} \]
                    2. Taylor expanded in x around inf

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

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

                      if 5.0000000000000003e-124 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e63

                      1. Initial program 99.9%

                        \[x + y \cdot \frac{z - t}{z - a} \]
                      2. Taylor expanded in z around inf

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

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

                      Alternative 15: 66.8% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq 1.15 \cdot 10^{-119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
                      (FPCore (x y z t a)
                       :precision binary64
                       (if (<= (/ (- z t) (- z a)) 1.15e-119) x (+ x y)))
                      double code(double x, double y, double z, double t, double a) {
                      	double tmp;
                      	if (((z - t) / (z - a)) <= 1.15e-119) {
                      		tmp = x;
                      	} else {
                      		tmp = x + y;
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z, t, a)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: t
                          real(8), intent (in) :: a
                          real(8) :: tmp
                          if (((z - t) / (z - a)) <= 1.15d-119) then
                              tmp = x
                          else
                              tmp = x + y
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t, double a) {
                      	double tmp;
                      	if (((z - t) / (z - a)) <= 1.15e-119) {
                      		tmp = x;
                      	} else {
                      		tmp = x + y;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a):
                      	tmp = 0
                      	if ((z - t) / (z - a)) <= 1.15e-119:
                      		tmp = x
                      	else:
                      		tmp = x + y
                      	return tmp
                      
                      function code(x, y, z, t, a)
                      	tmp = 0.0
                      	if (Float64(Float64(z - t) / Float64(z - a)) <= 1.15e-119)
                      		tmp = x;
                      	else
                      		tmp = Float64(x + y);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a)
                      	tmp = 0.0;
                      	if (((z - t) / (z - a)) <= 1.15e-119)
                      		tmp = x;
                      	else
                      		tmp = x + y;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], 1.15e-119], x, N[(x + y), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\frac{z - t}{z - a} \leq 1.15 \cdot 10^{-119}:\\
                      \;\;\;\;x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x + y\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.14999999999999997e-119

                        1. Initial program 98.1%

                          \[x + y \cdot \frac{z - t}{z - a} \]
                        2. Taylor expanded in x around inf

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

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

                          if 1.14999999999999997e-119 < (/.f64 (-.f64 z t) (-.f64 z a))

                          1. Initial program 98.6%

                            \[x + y \cdot \frac{z - t}{z - a} \]
                          2. Taylor expanded in z around inf

                            \[\leadsto x + \color{blue}{y} \]
                          3. Step-by-step derivation
                            1. Applied rewrites73.8%

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

                          Alternative 16: 52.8% accurate, 1.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-122}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (if (<= x -1.65e-87) x (if (<= x 7.5e-122) y x)))
                          double code(double x, double y, double z, double t, double a) {
                          	double tmp;
                          	if (x <= -1.65e-87) {
                          		tmp = x;
                          	} else if (x <= 7.5e-122) {
                          		tmp = y;
                          	} else {
                          		tmp = x;
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(x, y, z, t, a)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8), intent (in) :: a
                              real(8) :: tmp
                              if (x <= (-1.65d-87)) then
                                  tmp = x
                              else if (x <= 7.5d-122) then
                                  tmp = y
                              else
                                  tmp = x
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a) {
                          	double tmp;
                          	if (x <= -1.65e-87) {
                          		tmp = x;
                          	} else if (x <= 7.5e-122) {
                          		tmp = y;
                          	} else {
                          		tmp = x;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a):
                          	tmp = 0
                          	if x <= -1.65e-87:
                          		tmp = x
                          	elif x <= 7.5e-122:
                          		tmp = y
                          	else:
                          		tmp = x
                          	return tmp
                          
                          function code(x, y, z, t, a)
                          	tmp = 0.0
                          	if (x <= -1.65e-87)
                          		tmp = x;
                          	elseif (x <= 7.5e-122)
                          		tmp = y;
                          	else
                          		tmp = x;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a)
                          	tmp = 0.0;
                          	if (x <= -1.65e-87)
                          		tmp = x;
                          	elseif (x <= 7.5e-122)
                          		tmp = y;
                          	else
                          		tmp = x;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.65e-87], x, If[LessEqual[x, 7.5e-122], y, x]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;x \leq -1.65 \cdot 10^{-87}:\\
                          \;\;\;\;x\\
                          
                          \mathbf{elif}\;x \leq 7.5 \cdot 10^{-122}:\\
                          \;\;\;\;y\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;x\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -1.65e-87 or 7.4999999999999998e-122 < x

                            1. Initial program 98.6%

                              \[x + y \cdot \frac{z - t}{z - a} \]
                            2. Taylor expanded in x around inf

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

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

                              if -1.65e-87 < x < 7.4999999999999998e-122

                              1. Initial program 98.1%

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

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

                                  \[\leadsto \frac{y \cdot z}{z - a} + \color{blue}{x} \]
                                2. associate-/l*N/A

                                  \[\leadsto y \cdot \frac{z}{z - a} + x \]
                                3. *-commutativeN/A

                                  \[\leadsto \frac{z}{z - a} \cdot y + x \]
                                4. lower-fma.f64N/A

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

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

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

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

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

                                  \[\leadsto y \cdot \frac{z}{\color{blue}{z - a}} \]
                                2. *-commutativeN/A

                                  \[\leadsto \frac{z}{z - a} \cdot y \]
                                3. lower-*.f64N/A

                                  \[\leadsto \frac{z}{z - a} \cdot y \]
                                4. lift-/.f64N/A

                                  \[\leadsto \frac{z}{z - a} \cdot y \]
                                5. lift--.f6438.4

                                  \[\leadsto \frac{z}{z - a} \cdot y \]
                              7. Applied rewrites38.4%

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

                                \[\leadsto y \]
                              9. Step-by-step derivation
                                1. Applied rewrites29.4%

                                  \[\leadsto y \]
                              10. Recombined 2 regimes into one program.
                              11. Add Preprocessing

                              Alternative 17: 50.7% accurate, 15.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 98.4%

                                \[x + y \cdot \frac{z - t}{z - a} \]
                              2. Taylor expanded in x around inf

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

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

                                Reproduce

                                ?
                                herbie shell --seed 2025130 
                                (FPCore (x y z t a)
                                  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
                                  :precision binary64
                                  (+ x (* y (/ (- z t) (- z a)))))