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

Percentage Accurate: 98.0% → 98.0%
Time: 4.8s
Alternatives: 14
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 14 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.0% 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.0% 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.0%

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

Alternative 2: 92.4% accurate, 0.4× 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 -2 \cdot 10^{-125}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, 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 -2e-125) t_2 (if (<= t_1 2.0) (fma y (/ z (- z a)) 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 <= -2e-125) {
		tmp = t_2;
	} else if (t_1 <= 2.0) {
		tmp = fma(y, (z / (z - a)), 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 <= -2e-125)
		tmp = t_2;
	elseif (t_1 <= 2.0)
		tmp = fma(y, Float64(z / Float64(z - a)), 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, -2e-125], t$95$2, If[LessEqual[t$95$1, 2.0], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + 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 -2 \cdot 10^{-125}:\\
\;\;\;\;t\_2\\

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

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


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

    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.f6492.1

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

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

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

    1. Initial program 99.2%

      \[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. lower-fma.f64N/A

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

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

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

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

Alternative 3: 83.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := \mathsf{fma}\left(y, \frac{z - t}{z}, x\right)\\ \mathbf{if}\;t\_1 \leq -50000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-125}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{elif}\;t\_1 \leq 0.0002:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, 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 (fma y (/ (- z t) z) x)))
   (if (<= t_1 -50000000.0)
     t_2
     (if (<= t_1 -2e-125)
       (fma (/ t a) y x)
       (if (<= t_1 0.0002) (fma y (/ z (- z a)) 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 = fma(y, ((z - t) / z), x);
	double tmp;
	if (t_1 <= -50000000.0) {
		tmp = t_2;
	} else if (t_1 <= -2e-125) {
		tmp = fma((t / a), y, x);
	} else if (t_1 <= 0.0002) {
		tmp = fma(y, (z / (z - a)), 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 = fma(y, Float64(Float64(z - t) / z), x)
	tmp = 0.0
	if (t_1 <= -50000000.0)
		tmp = t_2;
	elseif (t_1 <= -2e-125)
		tmp = fma(Float64(t / a), y, x);
	elseif (t_1 <= 0.0002)
		tmp = fma(y, Float64(z / Float64(z - a)), 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[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -50000000.0], t$95$2, If[LessEqual[t$95$1, -2e-125], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0002], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_1 \leq 0.0002:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, 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)) < -5e7 or 2.0000000000000001e-4 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 97.7%

      \[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. lower-fma.f64N/A

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

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

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

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

    if -5e7 < (/.f64 (-.f64 z t) (-.f64 z a)) < -2.00000000000000002e-125

    1. Initial program 99.8%

      \[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-/.f6480.0

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

      \[\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.f6480.0

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

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

    if -2.00000000000000002e-125 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-4

    1. Initial program 98.3%

      \[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. lower-fma.f64N/A

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

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

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

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

Alternative 4: 83.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := \mathsf{fma}\left(y, \frac{z - t}{z}, x\right)\\ \mathbf{if}\;t\_1 \leq -50000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0.0002:\\ \;\;\;\;x + \left(-\frac{\left(z - t\right) \cdot y}{a}\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 (fma y (/ (- z t) z) x)))
   (if (<= t_1 -50000000.0)
     t_2
     (if (<= t_1 0.0002) (+ x (- (/ (* (- z t) y) a))) 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, ((z - t) / z), x);
	double tmp;
	if (t_1 <= -50000000.0) {
		tmp = t_2;
	} else if (t_1 <= 0.0002) {
		tmp = x + -(((z - t) * y) / a);
	} 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(y, Float64(Float64(z - t) / z), x)
	tmp = 0.0
	if (t_1 <= -50000000.0)
		tmp = t_2;
	elseif (t_1 <= 0.0002)
		tmp = Float64(x + Float64(-Float64(Float64(Float64(z - t) * y) / a)));
	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[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, -50000000.0], t$95$2, If[LessEqual[t$95$1, 0.0002], N[(x + (-N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision])), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 0.0002:\\
\;\;\;\;x + \left(-\frac{\left(z - t\right) \cdot y}{a}\right)\\

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


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

    1. Initial program 97.7%

      \[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. lower-fma.f64N/A

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

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

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

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

    if -5e7 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e-4

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

Alternative 5: 82.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := \left(-t\right) \cdot \frac{y}{z - a}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+36}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+27}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, 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 (* (- t) (/ y (- z a)))))
   (if (<= t_1 -2e+36) t_2 (if (<= t_1 1e+27) (fma y (/ z (- z a)) 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 = -t * (y / (z - a));
	double tmp;
	if (t_1 <= -2e+36) {
		tmp = t_2;
	} else if (t_1 <= 1e+27) {
		tmp = fma(y, (z / (z - a)), 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(Float64(-t) * Float64(y / Float64(z - a)))
	tmp = 0.0
	if (t_1 <= -2e+36)
		tmp = t_2;
	elseif (t_1 <= 1e+27)
		tmp = fma(y, Float64(z / Float64(z - a)), 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[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+36], t$95$2, If[LessEqual[t$95$1, 1e+27], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \left(\left(-\frac{\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)}{t}\right) + \frac{y}{\color{blue}{z - a}}\right) \]
      15. lift--.f6496.0

        \[\leadsto \left(-t\right) \cdot \left(\left(-\frac{\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)}{t}\right) + \frac{y}{z - \color{blue}{a}}\right) \]
    4. Applied rewrites96.0%

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

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

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

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

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

    if -2.00000000000000008e36 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e27

    1. Initial program 99.3%

      \[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. lower-fma.f64N/A

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

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

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

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

Alternative 6: 80.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := \left(-t\right) \cdot \frac{y}{z - a}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+45}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+27}:\\ \;\;\;\;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 (- z a)))))
   (if (<= t_1 -5e+45)
     t_2
     (if (<= t_1 2e-30) (fma (/ t a) y x) (if (<= t_1 1e+27) (+ 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 / (z - a));
	double tmp;
	if (t_1 <= -5e+45) {
		tmp = t_2;
	} else if (t_1 <= 2e-30) {
		tmp = fma((t / a), y, x);
	} else if (t_1 <= 1e+27) {
		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(-t) * Float64(y / Float64(z - a)))
	tmp = 0.0
	if (t_1 <= -5e+45)
		tmp = t_2;
	elseif (t_1 <= 2e-30)
		tmp = fma(Float64(t / a), y, x);
	elseif (t_1 <= 1e+27)
		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[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+45], t$95$2, If[LessEqual[t$95$1, 2e-30], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+27], N[(x + y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_1 \leq 10^{+27}:\\
\;\;\;\;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)) < -5e45 or 1e27 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-t\right) \cdot \left(\left(-\frac{\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)}{t}\right) + \frac{y}{\color{blue}{z - a}}\right) \]
      15. lift--.f6496.1

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

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

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

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

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

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

    if -5e45 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-30

    1. Initial program 98.7%

      \[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-/.f6483.7

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

      \[\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.f6483.7

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

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

    if 2e-30 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e27

    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 rewrites92.4%

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

    Alternative 7: 78.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^{-30}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+73}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ (- z t) (- z a))))
       (if (<= t_1 2e-30)
         (fma (/ t a) y x)
         (if (<= t_1 1e+73) (+ x y) (* y (- 1.0 (/ t z)))))))
    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-30) {
    		tmp = fma((t / a), y, x);
    	} else if (t_1 <= 1e+73) {
    		tmp = x + y;
    	} else {
    		tmp = y * (1.0 - (t / z));
    	}
    	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-30)
    		tmp = fma(Float64(t / a), y, x);
    	elseif (t_1 <= 1e+73)
    		tmp = Float64(x + y);
    	else
    		tmp = Float64(y * Float64(1.0 - Float64(t / z)));
    	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-30], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+73], N[(x + y), $MachinePrecision], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{z - t}{z - a}\\
    \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-30}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+73}:\\
    \;\;\;\;x + y\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-30

      1. Initial program 97.2%

        \[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-/.f6477.1

          \[\leadsto x + y \cdot \frac{t}{\color{blue}{a}} \]
      4. Applied rewrites77.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.f6477.1

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

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

      if 2e-30 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.99999999999999983e72

      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 rewrites88.6%

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

        if 9.99999999999999983e72 < (/.f64 (-.f64 z t) (-.f64 z a))

        1. Initial program 94.8%

          \[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. lower-fma.f64N/A

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

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

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

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

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

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

            \[\leadsto y \cdot \left(1 - \frac{t}{\color{blue}{z}}\right) \]
          3. lower-/.f6446.0

            \[\leadsto y \cdot \left(1 - \frac{t}{z}\right) \]
        7. Applied rewrites46.0%

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

      Alternative 8: 78.3% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+81}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (/ (- z t) (- z a))))
         (if (<= t_1 2e-30)
           (fma (/ t a) y x)
           (if (<= t_1 2e+81) (+ x y) (* (- t) (/ y z))))))
      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-30) {
      		tmp = fma((t / a), y, x);
      	} else if (t_1 <= 2e+81) {
      		tmp = x + y;
      	} else {
      		tmp = -t * (y / z);
      	}
      	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-30)
      		tmp = fma(Float64(t / a), y, x);
      	elseif (t_1 <= 2e+81)
      		tmp = Float64(x + y);
      	else
      		tmp = Float64(Float64(-t) * Float64(y / z));
      	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-30], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+81], N[(x + y), $MachinePrecision], N[((-t) * N[(y / z), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{z - t}{z - a}\\
      \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-30}:\\
      \;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
      
      \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+81}:\\
      \;\;\;\;x + y\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-30

        1. Initial program 97.2%

          \[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-/.f6477.1

            \[\leadsto x + y \cdot \frac{t}{\color{blue}{a}} \]
        4. Applied rewrites77.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.f6477.1

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

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

        if 2e-30 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999984e81

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

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

          if 1.99999999999999984e81 < (/.f64 (-.f64 z t) (-.f64 z a))

          1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-t\right) \cdot \left(\left(-\frac{\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)}{t}\right) + \frac{y}{\color{blue}{z - a}}\right) \]
            15. lift--.f6496.3

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

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

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

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

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

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

            \[\leadsto \left(-t\right) \cdot \frac{y}{z} \]
          9. Step-by-step derivation
            1. Applied rewrites47.4%

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

          Alternative 9: 78.2% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+81}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (let* ((t_1 (/ (- z t) (- z a))))
             (if (<= t_1 2e-30)
               (fma t (/ y a) x)
               (if (<= t_1 2e+81) (+ x y) (* (- t) (/ y z))))))
          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-30) {
          		tmp = fma(t, (y / a), x);
          	} else if (t_1 <= 2e+81) {
          		tmp = x + y;
          	} else {
          		tmp = -t * (y / z);
          	}
          	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-30)
          		tmp = fma(t, Float64(y / a), x);
          	elseif (t_1 <= 2e+81)
          		tmp = Float64(x + y);
          	else
          		tmp = Float64(Float64(-t) * Float64(y / z));
          	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-30], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+81], N[(x + y), $MachinePrecision], N[((-t) * N[(y / z), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \frac{z - t}{z - a}\\
          \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-30}:\\
          \;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
          
          \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+81}:\\
          \;\;\;\;x + y\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-30

            1. Initial program 97.2%

              \[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. lower-fma.f64N/A

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

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

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

            if 2e-30 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999984e81

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

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

              if 1.99999999999999984e81 < (/.f64 (-.f64 z t) (-.f64 z a))

              1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-t\right) \cdot \left(\left(-\frac{\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)}{t}\right) + \frac{y}{\color{blue}{z - a}}\right) \]
                15. lift--.f6496.3

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

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

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

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

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

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

                \[\leadsto \left(-t\right) \cdot \frac{y}{z} \]
              9. Step-by-step derivation
                1. Applied rewrites47.4%

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

              Alternative 10: 71.2% accurate, 0.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := \left(-t\right) \cdot \frac{y}{z}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+72}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+81}:\\ \;\;\;\;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 z))))
                 (if (<= t_1 -2e+72)
                   t_2
                   (if (<= t_1 2e-30) x (if (<= t_1 2e+81) (+ 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 / z);
              	double tmp;
              	if (t_1 <= -2e+72) {
              		tmp = t_2;
              	} else if (t_1 <= 2e-30) {
              		tmp = x;
              	} else if (t_1 <= 2e+81) {
              		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 / z)
                  if (t_1 <= (-2d+72)) then
                      tmp = t_2
                  else if (t_1 <= 2d-30) then
                      tmp = x
                  else if (t_1 <= 2d+81) 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 / z);
              	double tmp;
              	if (t_1 <= -2e+72) {
              		tmp = t_2;
              	} else if (t_1 <= 2e-30) {
              		tmp = x;
              	} else if (t_1 <= 2e+81) {
              		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 / z)
              	tmp = 0
              	if t_1 <= -2e+72:
              		tmp = t_2
              	elif t_1 <= 2e-30:
              		tmp = x
              	elif t_1 <= 2e+81:
              		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(-t) * Float64(y / z))
              	tmp = 0.0
              	if (t_1 <= -2e+72)
              		tmp = t_2;
              	elseif (t_1 <= 2e-30)
              		tmp = x;
              	elseif (t_1 <= 2e+81)
              		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 / z);
              	tmp = 0.0;
              	if (t_1 <= -2e+72)
              		tmp = t_2;
              	elseif (t_1 <= 2e-30)
              		tmp = x;
              	elseif (t_1 <= 2e+81)
              		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 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+72], t$95$2, If[LessEqual[t$95$1, 2e-30], x, If[LessEqual[t$95$1, 2e+81], N[(x + y), $MachinePrecision], t$95$2]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \frac{z - t}{z - a}\\
              t_2 := \left(-t\right) \cdot \frac{y}{z}\\
              \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+72}:\\
              \;\;\;\;t\_2\\
              
              \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-30}:\\
              \;\;\;\;x\\
              
              \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+81}:\\
              \;\;\;\;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)) < -1.99999999999999989e72 or 1.99999999999999984e81 < (/.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 \left(t \cdot \left(-1 \cdot \frac{x + \frac{y \cdot z}{z - a}}{t} + \frac{y}{z - a}\right)\right)} \]
                3. Step-by-step derivation
                  1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-t\right) \cdot \left(\left(-\frac{\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)}{t}\right) + \frac{y}{\color{blue}{z - a}}\right) \]
                  15. lift--.f6496.9

                    \[\leadsto \left(-t\right) \cdot \left(\left(-\frac{\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)}{t}\right) + \frac{y}{z - \color{blue}{a}}\right) \]
                4. Applied rewrites96.9%

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

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

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

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

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

                  \[\leadsto \left(-t\right) \cdot \frac{y}{z} \]
                9. Step-by-step derivation
                  1. Applied rewrites47.1%

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

                  if -1.99999999999999989e72 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-30

                  1. Initial program 98.7%

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

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

                    if 2e-30 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.99999999999999984e81

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

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

                    Alternative 11: 68.5% accurate, 0.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-30}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+161}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \end{array} \end{array} \]
                    (FPCore (x y z t a)
                     :precision binary64
                     (let* ((t_1 (/ (- z t) (- z a))))
                       (if (<= t_1 2e-30) x (if (<= t_1 4e+161) (+ x y) (/ (* t y) 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-30) {
                    		tmp = x;
                    	} else if (t_1 <= 4e+161) {
                    		tmp = x + y;
                    	} else {
                    		tmp = (t * y) / a;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z, t, a)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8), intent (in) :: a
                        real(8) :: t_1
                        real(8) :: tmp
                        t_1 = (z - t) / (z - a)
                        if (t_1 <= 2d-30) then
                            tmp = x
                        else if (t_1 <= 4d+161) then
                            tmp = x + y
                        else
                            tmp = (t * y) / 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-30) {
                    		tmp = x;
                    	} else if (t_1 <= 4e+161) {
                    		tmp = x + y;
                    	} else {
                    		tmp = (t * y) / a;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t, a):
                    	t_1 = (z - t) / (z - a)
                    	tmp = 0
                    	if t_1 <= 2e-30:
                    		tmp = x
                    	elif t_1 <= 4e+161:
                    		tmp = x + y
                    	else:
                    		tmp = (t * y) / 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-30)
                    		tmp = x;
                    	elseif (t_1 <= 4e+161)
                    		tmp = Float64(x + y);
                    	else
                    		tmp = Float64(Float64(t * y) / 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-30)
                    		tmp = x;
                    	elseif (t_1 <= 4e+161)
                    		tmp = x + y;
                    	else
                    		tmp = (t * y) / 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-30], x, If[LessEqual[t$95$1, 4e+161], N[(x + y), $MachinePrecision], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \frac{z - t}{z - a}\\
                    \mathbf{if}\;t\_1 \leq 2 \cdot 10^{-30}:\\
                    \;\;\;\;x\\
                    
                    \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+161}:\\
                    \;\;\;\;x + y\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{t \cdot y}{a}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-30

                      1. Initial program 97.2%

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

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

                        if 2e-30 < (/.f64 (-.f64 z t) (-.f64 z a)) < 4.0000000000000002e161

                        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 rewrites83.5%

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

                          if 4.0000000000000002e161 < (/.f64 (-.f64 z t) (-.f64 z a))

                          1. Initial program 91.3%

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{-1 \cdot \left(t \cdot y\right) + y \cdot z}{\color{blue}{z} - a} \]
                          6. Step-by-step derivation
                            1. associate-*r*N/A

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

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

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

                              \[\leadsto \frac{\mathsf{fma}\left(-t, y, y \cdot z\right)}{z - a} \]
                            5. *-commutativeN/A

                              \[\leadsto \frac{\mathsf{fma}\left(-t, y, z \cdot y\right)}{z - a} \]
                            6. lower-*.f6483.9

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

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

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

                              \[\leadsto \frac{t \cdot y}{a} \]
                            2. lower-*.f6454.9

                              \[\leadsto \frac{t \cdot y}{a} \]
                          10. Applied rewrites54.9%

                            \[\leadsto \frac{t \cdot y}{\color{blue}{a}} \]
                        4. Recombined 3 regimes into one program.
                        5. Add Preprocessing

                        Alternative 12: 66.0% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq 4.6 \cdot 10^{-21}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
                        (FPCore (x y z t a)
                         :precision binary64
                         (if (<= (/ (- z t) (- z a)) 4.6e-21) x (+ x y)))
                        double code(double x, double y, double z, double t, double a) {
                        	double tmp;
                        	if (((z - t) / (z - a)) <= 4.6e-21) {
                        		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)) <= 4.6d-21) 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)) <= 4.6e-21) {
                        		tmp = x;
                        	} else {
                        		tmp = x + y;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t, a):
                        	tmp = 0
                        	if ((z - t) / (z - a)) <= 4.6e-21:
                        		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)) <= 4.6e-21)
                        		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)) <= 4.6e-21)
                        		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], 4.6e-21], x, N[(x + y), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;\frac{z - t}{z - a} \leq 4.6 \cdot 10^{-21}:\\
                        \;\;\;\;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)) < 4.59999999999999999e-21

                          1. Initial program 97.2%

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

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

                            if 4.59999999999999999e-21 < (/.f64 (-.f64 z t) (-.f64 z a))

                            1. Initial program 98.8%

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

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

                            Alternative 13: 54.6% accurate, 0.5× speedup?

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

                              1. Initial program 95.1%

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

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

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

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

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

                                  \[\leadsto \frac{\left(z - t\right) \cdot y}{z - a} \]
                                5. lift--.f6460.0

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

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

                                \[\leadsto \frac{-1 \cdot \left(t \cdot y\right) + y \cdot z}{\color{blue}{z} - a} \]
                              6. Step-by-step derivation
                                1. associate-*r*N/A

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

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

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

                                  \[\leadsto \frac{\mathsf{fma}\left(-t, y, y \cdot z\right)}{z - a} \]
                                5. *-commutativeN/A

                                  \[\leadsto \frac{\mathsf{fma}\left(-t, y, z \cdot y\right)}{z - a} \]
                                6. lower-*.f6458.8

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

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

                                \[\leadsto y \]
                              9. Step-by-step derivation
                                1. Applied rewrites26.8%

                                  \[\leadsto y \]

                                if -4e153 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 1e129

                                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 rewrites66.8%

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

                                Alternative 14: 50.1% 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.0%

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

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

                                  Reproduce

                                  ?
                                  herbie shell --seed 2025120 
                                  (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)))))