Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.4% → 94.5%
Time: 5.3s
Alternatives: 20
Speedup: 0.3×

Specification

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

\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\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 20 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: 80.4% accurate, 1.0× speedup?

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

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

Alternative 1: 94.5% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{1}{a - z} \cdot \left(y - z\right)}, x\right) \]
      10. frac-2negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(t - x, \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(y - z\right), x\right) \]
      14. sub-negate-revN/A

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

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

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

    if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
      4. sub-flip-reverseN/A

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

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

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

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

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

        \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

Alternative 2: 90.6% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x + \frac{z - y}{\frac{z - a}{t - x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273

    1. Initial program 80.4%

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

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

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

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

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

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

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

        \[\leadsto x - \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)\right) \cdot \frac{t - x}{a - z} \]
      8. sub-negate-revN/A

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

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

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

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

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

        \[\leadsto x - \left(z - y\right) \cdot \frac{\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      14. sub-negate-revN/A

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

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

        \[\leadsto x - \left(z - y\right) \cdot \frac{x - t}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \]
      17. sub-negate-revN/A

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

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

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

    if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
      4. sub-flip-reverseN/A

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

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

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

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

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

        \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

    if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 80.4%

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

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

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

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}} \]
      4. mult-flip-revN/A

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

        \[\leadsto x + \frac{\color{blue}{y - z}}{\frac{a - z}{t - x}} \]
      6. sub-negate-revN/A

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

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

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

        \[\leadsto x + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y - z\right)\right)\right)\right)}{\frac{\color{blue}{a - z}}{t - x}} \]
      10. sub-negate-revN/A

        \[\leadsto x + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y - z\right)\right)\right)\right)}{\frac{\color{blue}{\mathsf{neg}\left(\left(z - a\right)\right)}}{t - x}} \]
      11. sub-negate-revN/A

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

        \[\leadsto x + \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(y - z\right)\right)\right)\right)}{\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)\right)\right)}{t - x}} \]
      13. distribute-frac-negN/A

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

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

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

        \[\leadsto x + \frac{\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)}{\frac{\mathsf{neg}\left(\left(a - z\right)\right)}{t - x}} \]
      17. sub-negate-revN/A

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

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

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

        \[\leadsto x + \frac{z - y}{\frac{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}{t - x}} \]
      21. sub-negate-revN/A

        \[\leadsto x + \frac{z - y}{\frac{\color{blue}{z - a}}{t - x}} \]
      22. lower--.f6480.5

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

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

Alternative 3: 90.6% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, y - z, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273

    1. Initial program 80.4%

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

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

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

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

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

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

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

        \[\leadsto x - \left(\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)\right) \cdot \frac{t - x}{a - z} \]
      8. sub-negate-revN/A

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

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

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

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

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

        \[\leadsto x - \left(z - y\right) \cdot \frac{\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)} \]
      14. sub-negate-revN/A

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

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

        \[\leadsto x - \left(z - y\right) \cdot \frac{x - t}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \]
      17. sub-negate-revN/A

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

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

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

    if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
      4. sub-flip-reverseN/A

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

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

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

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

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

        \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

    if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      10. sub-negate-revN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, y - z, x\right) \]
      13. sub-negate-revN/A

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

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

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

Alternative 4: 90.6% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1e-273 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(t - x\right)}\right)}{\mathsf{neg}\left(\left(a - z\right)\right)}, y - z, x\right) \]
      10. sub-negate-revN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{x - t}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)}, y - z, x\right) \]
      13. sub-negate-revN/A

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

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

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

    if -1e-273 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
      4. sub-flip-reverseN/A

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

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

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

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

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

        \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

Alternative 5: 78.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.8 \cdot 10^{-191}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.9999999999999996e22 or 1.5500000000000001e75 < z

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
      4. sub-flip-reverseN/A

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

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

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

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

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

        \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
      10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
      7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

    if -8.9999999999999996e22 < z < -1.8000000000000001e-191 or 1.1999999999999999e-143 < z < 1.5500000000000001e75

    1. Initial program 80.4%

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

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

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

      if -1.8000000000000001e-191 < z < 1.1999999999999999e-143

      1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{1}{a - z} \cdot \left(y - z\right)}, x\right) \]
        10. frac-2negN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(t - x, \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(y - z\right), x\right) \]
        14. sub-negate-revN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{y}{a}}, x\right) \]
      5. Step-by-step derivation
        1. lower-/.f6448.8

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

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

    Alternative 6: 77.1% accurate, 0.7× speedup?

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

      1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
        4. sub-flip-reverseN/A

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

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

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

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

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

          \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
        10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
        7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

      if -6.5999999999999996e22 < z < 1.7999999999999999e-143

      1. Initial program 80.4%

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

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

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

        if 1.7999999999999999e-143 < z < 1.5500000000000001e75

        1. Initial program 80.4%

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

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

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

          if 1.5500000000000001e75 < z

          1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
            4. sub-flip-reverseN/A

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

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

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

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

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

              \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
            10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t - \frac{t - x}{\color{blue}{\frac{z}{y - a}}} \]
            6. lower-/.f6453.4

              \[\leadsto t - \frac{t - x}{\frac{z}{\color{blue}{y - a}}} \]
          8. Applied rewrites53.4%

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

        Alternative 7: 75.6% accurate, 0.7× speedup?

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

          1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
            4. sub-flip-reverseN/A

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

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

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

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

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

              \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
            10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
            7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

          if -6.5999999999999996e22 < z < 1.7999999999999999e-143

          1. Initial program 80.4%

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

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

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

            if 1.7999999999999999e-143 < z < 1.5500000000000001e75

            1. Initial program 80.4%

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

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

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

            Alternative 8: 75.6% accurate, 0.8× speedup?

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

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
                4. sub-flip-reverseN/A

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

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

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

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

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

                  \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
                7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

              if -7e22 < z < 1.1e30

              1. Initial program 80.4%

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

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

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

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

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

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

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

            Alternative 9: 74.1% accurate, 0.8× speedup?

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

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
                4. sub-flip-reverseN/A

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

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

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

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

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

                  \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto t + \left(\mathsf{neg}\left(\frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\right)\right) \]
                7. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

              if -6.5999999999999996e22 < z < 250

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{1}{a - z} \cdot \left(y - z\right)}, x\right) \]
                10. frac-2negN/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(t - x, \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(y - z\right), x\right) \]
                14. sub-negate-revN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{y}{a}}, x\right) \]
              5. Step-by-step derivation
                1. lower-/.f6448.8

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

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

            Alternative 10: 70.3% accurate, 0.9× speedup?

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

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
                4. sub-flip-reverseN/A

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

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

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

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

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

                  \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                10. distribute-rgt-out--N/A

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

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

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

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

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

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

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

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

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

              if -7e22 < z < 250

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{1}{a - z} \cdot \left(y - z\right)}, x\right) \]
                10. frac-2negN/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(t - x, \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(y - z\right), x\right) \]
                14. sub-negate-revN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{y}{a}}, x\right) \]
              5. Step-by-step derivation
                1. lower-/.f6448.8

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

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

            Alternative 11: 63.4% accurate, 0.9× speedup?

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

              1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto t + \left(\mathsf{neg}\left(\frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\right)\right) \]
                4. sub-flip-reverseN/A

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

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

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

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

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

                  \[\leadsto t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                10. distribute-rgt-out--N/A

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

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

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

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

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

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

                \[\leadsto t - t \cdot \frac{\color{blue}{y - a}}{z} \]
              8. Step-by-step derivation
                1. Applied rewrites36.3%

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

                if -8.7999999999999995e27 < z < 9.39999999999999979e30

                1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{1}{a - z} \cdot \left(y - z\right)}, x\right) \]
                  10. frac-2negN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(t - x, \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(y - z\right), x\right) \]
                  14. sub-negate-revN/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{y}{a}}, x\right) \]
                5. Step-by-step derivation
                  1. lower-/.f6448.8

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

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

              Alternative 12: 60.5% accurate, 0.9× speedup?

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

                1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{1}{a - z} \cdot \left(y - z\right)}, x\right) \]
                  10. frac-2negN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(t - x, \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(y - z\right), x\right) \]
                  14. sub-negate-revN/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{y}{a}}, x\right) \]
                5. Step-by-step derivation
                  1. lower-/.f6448.8

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

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

                if -3.8000000000000003e47 < a < 5.99999999999999946e-8

                1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{t - x}{a - z} \cdot y \]
                  8. sub-negate-revN/A

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

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

                    \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                  11. sub-negate-revN/A

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

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

                    \[\leadsto \frac{x - t}{z - a} \cdot y \]
                  14. lift-/.f6441.9

                    \[\leadsto \frac{x - t}{z - a} \cdot y \]
                6. Applied rewrites41.9%

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

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

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

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

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

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

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

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

              Alternative 13: 57.2% accurate, 0.9× speedup?

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

                1. Initial program 80.4%

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

                  \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                3. Step-by-step derivation
                  1. lower--.f6419.8

                    \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                4. Applied rewrites19.8%

                  \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                5. Taylor expanded in x around 0

                  \[\leadsto x + t \]
                6. Step-by-step derivation
                  1. Applied rewrites33.7%

                    \[\leadsto x + t \]

                  if -1.59999999999999988e-23 < z < 2.1500000000000001e68

                  1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{1}{a - z} \cdot \left(y - z\right)}, x\right) \]
                    10. frac-2negN/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(t - x, \frac{-1}{\mathsf{neg}\left(\color{blue}{\left(a - z\right)}\right)} \cdot \left(y - z\right), x\right) \]
                    14. sub-negate-revN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(t - x, \color{blue}{\frac{y}{a}}, x\right) \]
                  5. Step-by-step derivation
                    1. lower-/.f6448.8

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

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

                Alternative 14: 44.0% accurate, 0.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{elif}\;t\_1 \leq 400000000:\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z - a}\\ \end{array} \end{array} \]
                (FPCore (x y z t a)
                 :precision binary64
                 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
                   (if (<= t_1 (- INFINITY))
                     (/ (* y (- x t)) z)
                     (if (<= t_1 -1e-295)
                       (+ x t)
                       (if (<= t_1 0.0)
                         (/ (* x (- y a)) z)
                         (if (<= t_1 400000000.0)
                           (* y (/ t (- a z)))
                           (if (<= t_1 4e+301) (+ x t) (/ (* x y) (- z a)))))))))
                double code(double x, double y, double z, double t, double a) {
                	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                	double tmp;
                	if (t_1 <= -((double) INFINITY)) {
                		tmp = (y * (x - t)) / z;
                	} else if (t_1 <= -1e-295) {
                		tmp = x + t;
                	} else if (t_1 <= 0.0) {
                		tmp = (x * (y - a)) / z;
                	} else if (t_1 <= 400000000.0) {
                		tmp = y * (t / (a - z));
                	} else if (t_1 <= 4e+301) {
                		tmp = x + t;
                	} else {
                		tmp = (x * y) / (z - a);
                	}
                	return tmp;
                }
                
                public static double code(double x, double y, double z, double t, double a) {
                	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                	double tmp;
                	if (t_1 <= -Double.POSITIVE_INFINITY) {
                		tmp = (y * (x - t)) / z;
                	} else if (t_1 <= -1e-295) {
                		tmp = x + t;
                	} else if (t_1 <= 0.0) {
                		tmp = (x * (y - a)) / z;
                	} else if (t_1 <= 400000000.0) {
                		tmp = y * (t / (a - z));
                	} else if (t_1 <= 4e+301) {
                		tmp = x + t;
                	} else {
                		tmp = (x * y) / (z - a);
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a):
                	t_1 = x + ((y - z) * ((t - x) / (a - z)))
                	tmp = 0
                	if t_1 <= -math.inf:
                		tmp = (y * (x - t)) / z
                	elif t_1 <= -1e-295:
                		tmp = x + t
                	elif t_1 <= 0.0:
                		tmp = (x * (y - a)) / z
                	elif t_1 <= 400000000.0:
                		tmp = y * (t / (a - z))
                	elif t_1 <= 4e+301:
                		tmp = x + t
                	else:
                		tmp = (x * y) / (z - a)
                	return tmp
                
                function code(x, y, z, t, a)
                	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                	tmp = 0.0
                	if (t_1 <= Float64(-Inf))
                		tmp = Float64(Float64(y * Float64(x - t)) / z);
                	elseif (t_1 <= -1e-295)
                		tmp = Float64(x + t);
                	elseif (t_1 <= 0.0)
                		tmp = Float64(Float64(x * Float64(y - a)) / z);
                	elseif (t_1 <= 400000000.0)
                		tmp = Float64(y * Float64(t / Float64(a - z)));
                	elseif (t_1 <= 4e+301)
                		tmp = Float64(x + t);
                	else
                		tmp = Float64(Float64(x * y) / Float64(z - a));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a)
                	t_1 = x + ((y - z) * ((t - x) / (a - z)));
                	tmp = 0.0;
                	if (t_1 <= -Inf)
                		tmp = (y * (x - t)) / z;
                	elseif (t_1 <= -1e-295)
                		tmp = x + t;
                	elseif (t_1 <= 0.0)
                		tmp = (x * (y - a)) / z;
                	elseif (t_1 <= 400000000.0)
                		tmp = y * (t / (a - z));
                	elseif (t_1 <= 4e+301)
                		tmp = x + t;
                	else
                		tmp = (x * y) / (z - a);
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-295], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 400000000.0], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+301], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                \mathbf{if}\;t\_1 \leq -\infty:\\
                \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\
                
                \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\
                \;\;\;\;x + t\\
                
                \mathbf{elif}\;t\_1 \leq 0:\\
                \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
                
                \mathbf{elif}\;t\_1 \leq 400000000:\\
                \;\;\;\;y \cdot \frac{t}{a - z}\\
                
                \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\
                \;\;\;\;x + t\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{x \cdot y}{z - a}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 5 regimes
                2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0

                  1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{t - x}{a - z} \cdot y \]
                    8. sub-negate-revN/A

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

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

                      \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                    11. sub-negate-revN/A

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

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

                      \[\leadsto \frac{x - t}{z - a} \cdot y \]
                    14. lift-/.f6441.9

                      \[\leadsto \frac{x - t}{z - a} \cdot y \]
                  6. Applied rewrites41.9%

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

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

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

                      \[\leadsto \frac{y \cdot \left(x - t\right)}{z} \]
                    3. lower--.f6423.8

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

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

                  if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000006e-295 or 4e8 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000021e301

                  1. Initial program 80.4%

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

                    \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                  3. Step-by-step derivation
                    1. lower--.f6419.8

                      \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                  4. Applied rewrites19.8%

                    \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                  5. Taylor expanded in x around 0

                    \[\leadsto x + t \]
                  6. Step-by-step derivation
                    1. Applied rewrites33.7%

                      \[\leadsto x + t \]

                    if -1.00000000000000006e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

                    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
                      3. lower--.f6419.8

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

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

                    if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4e8

                    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto y \cdot \frac{t}{a - \color{blue}{z}} \]
                      2. lower--.f6423.1

                        \[\leadsto y \cdot \frac{t}{a - z} \]
                    7. Applied rewrites23.1%

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

                    if 4.00000000000000021e301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{t - x}{a - z} \cdot y \]
                      8. sub-negate-revN/A

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

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

                        \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                      11. sub-negate-revN/A

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

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

                        \[\leadsto \frac{x - t}{z - a} \cdot y \]
                      14. lift-/.f6441.9

                        \[\leadsto \frac{x - t}{z - a} \cdot y \]
                    6. Applied rewrites41.9%

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

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

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

                        \[\leadsto \frac{x \cdot y}{z - a} \]
                      3. lower--.f6421.1

                        \[\leadsto \frac{x \cdot y}{z - a} \]
                    9. Applied rewrites21.1%

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

                  Alternative 15: 43.8% accurate, 0.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_1 \leq 10^{-53}:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{elif}\;t\_1 \leq 400000000:\\ \;\;\;\;\frac{t \cdot y}{a - z}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z - a}\\ \end{array} \end{array} \]
                  (FPCore (x y z t a)
                   :precision binary64
                   (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
                     (if (<= t_1 (- INFINITY))
                       (/ (* y (- x t)) z)
                       (if (<= t_1 -1e-295)
                         (+ x t)
                         (if (<= t_1 1e-53)
                           (/ (* x (- y a)) z)
                           (if (<= t_1 400000000.0)
                             (/ (* t y) (- a z))
                             (if (<= t_1 4e+301) (+ x t) (/ (* x y) (- z a)))))))))
                  double code(double x, double y, double z, double t, double a) {
                  	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                  	double tmp;
                  	if (t_1 <= -((double) INFINITY)) {
                  		tmp = (y * (x - t)) / z;
                  	} else if (t_1 <= -1e-295) {
                  		tmp = x + t;
                  	} else if (t_1 <= 1e-53) {
                  		tmp = (x * (y - a)) / z;
                  	} else if (t_1 <= 400000000.0) {
                  		tmp = (t * y) / (a - z);
                  	} else if (t_1 <= 4e+301) {
                  		tmp = x + t;
                  	} else {
                  		tmp = (x * y) / (z - a);
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double x, double y, double z, double t, double a) {
                  	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                  	double tmp;
                  	if (t_1 <= -Double.POSITIVE_INFINITY) {
                  		tmp = (y * (x - t)) / z;
                  	} else if (t_1 <= -1e-295) {
                  		tmp = x + t;
                  	} else if (t_1 <= 1e-53) {
                  		tmp = (x * (y - a)) / z;
                  	} else if (t_1 <= 400000000.0) {
                  		tmp = (t * y) / (a - z);
                  	} else if (t_1 <= 4e+301) {
                  		tmp = x + t;
                  	} else {
                  		tmp = (x * y) / (z - a);
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a):
                  	t_1 = x + ((y - z) * ((t - x) / (a - z)))
                  	tmp = 0
                  	if t_1 <= -math.inf:
                  		tmp = (y * (x - t)) / z
                  	elif t_1 <= -1e-295:
                  		tmp = x + t
                  	elif t_1 <= 1e-53:
                  		tmp = (x * (y - a)) / z
                  	elif t_1 <= 400000000.0:
                  		tmp = (t * y) / (a - z)
                  	elif t_1 <= 4e+301:
                  		tmp = x + t
                  	else:
                  		tmp = (x * y) / (z - a)
                  	return tmp
                  
                  function code(x, y, z, t, a)
                  	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                  	tmp = 0.0
                  	if (t_1 <= Float64(-Inf))
                  		tmp = Float64(Float64(y * Float64(x - t)) / z);
                  	elseif (t_1 <= -1e-295)
                  		tmp = Float64(x + t);
                  	elseif (t_1 <= 1e-53)
                  		tmp = Float64(Float64(x * Float64(y - a)) / z);
                  	elseif (t_1 <= 400000000.0)
                  		tmp = Float64(Float64(t * y) / Float64(a - z));
                  	elseif (t_1 <= 4e+301)
                  		tmp = Float64(x + t);
                  	else
                  		tmp = Float64(Float64(x * y) / Float64(z - a));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a)
                  	t_1 = x + ((y - z) * ((t - x) / (a - z)));
                  	tmp = 0.0;
                  	if (t_1 <= -Inf)
                  		tmp = (y * (x - t)) / z;
                  	elseif (t_1 <= -1e-295)
                  		tmp = x + t;
                  	elseif (t_1 <= 1e-53)
                  		tmp = (x * (y - a)) / z;
                  	elseif (t_1 <= 400000000.0)
                  		tmp = (t * y) / (a - z);
                  	elseif (t_1 <= 4e+301)
                  		tmp = x + t;
                  	else
                  		tmp = (x * y) / (z - a);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-295], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 1e-53], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 400000000.0], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+301], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                  \mathbf{if}\;t\_1 \leq -\infty:\\
                  \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\
                  
                  \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\
                  \;\;\;\;x + t\\
                  
                  \mathbf{elif}\;t\_1 \leq 10^{-53}:\\
                  \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
                  
                  \mathbf{elif}\;t\_1 \leq 400000000:\\
                  \;\;\;\;\frac{t \cdot y}{a - z}\\
                  
                  \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\
                  \;\;\;\;x + t\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{x \cdot y}{z - a}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 5 regimes
                  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0

                    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{t - x}{a - z} \cdot y \]
                      8. sub-negate-revN/A

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

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

                        \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                      11. sub-negate-revN/A

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

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

                        \[\leadsto \frac{x - t}{z - a} \cdot y \]
                      14. lift-/.f6441.9

                        \[\leadsto \frac{x - t}{z - a} \cdot y \]
                    6. Applied rewrites41.9%

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

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

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

                        \[\leadsto \frac{y \cdot \left(x - t\right)}{z} \]
                      3. lower--.f6423.8

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

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

                    if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000006e-295 or 4e8 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000021e301

                    1. Initial program 80.4%

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

                      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                    3. Step-by-step derivation
                      1. lower--.f6419.8

                        \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                    4. Applied rewrites19.8%

                      \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                    5. Taylor expanded in x around 0

                      \[\leadsto x + t \]
                    6. Step-by-step derivation
                      1. Applied rewrites33.7%

                        \[\leadsto x + t \]

                      if -1.00000000000000006e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000003e-53

                      1. Initial program 80.4%

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

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

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

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

                          \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{\color{blue}{z}} \]
                        4. lower--.f64N/A

                          \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                        5. lower-*.f64N/A

                          \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                        6. lower--.f64N/A

                          \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                        7. lower-*.f64N/A

                          \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                        8. lower--.f6446.1

                          \[\leadsto t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z} \]
                      4. Applied rewrites46.1%

                        \[\leadsto \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
                      5. Taylor expanded in x around -inf

                        \[\leadsto \frac{x \cdot \left(y - a\right)}{\color{blue}{z}} \]
                      6. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
                        2. lower-*.f64N/A

                          \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
                        3. lower--.f6419.8

                          \[\leadsto \frac{x \cdot \left(y - a\right)}{z} \]
                      7. Applied rewrites19.8%

                        \[\leadsto \frac{x \cdot \left(y - a\right)}{\color{blue}{z}} \]

                      if 1.00000000000000003e-53 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4e8

                      1. Initial program 80.4%

                        \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                      2. Taylor expanded in y around inf

                        \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                      3. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                        2. lower--.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                        3. lower-/.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                        4. lower--.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                        5. lower-/.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                        6. lower--.f6441.5

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                      4. Applied rewrites41.5%

                        \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                      5. Taylor expanded in x around 0

                        \[\leadsto \frac{t \cdot y}{\color{blue}{a - z}} \]
                      6. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{t \cdot y}{a - \color{blue}{z}} \]
                        2. lower-*.f64N/A

                          \[\leadsto \frac{t \cdot y}{a - z} \]
                        3. lower--.f6421.3

                          \[\leadsto \frac{t \cdot y}{a - z} \]
                      7. Applied rewrites21.3%

                        \[\leadsto \frac{t \cdot y}{\color{blue}{a - z}} \]

                      if 4.00000000000000021e301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                      1. Initial program 80.4%

                        \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                      2. Taylor expanded in y around inf

                        \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                      3. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                        2. lower--.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                        3. lower-/.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                        4. lower--.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                        5. lower-/.f64N/A

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                        6. lower--.f6441.5

                          \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                      4. Applied rewrites41.5%

                        \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                      5. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                        2. *-commutativeN/A

                          \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
                        3. lower-*.f6441.5

                          \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
                        4. lift--.f64N/A

                          \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                        5. lift-/.f64N/A

                          \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                        6. lift-/.f64N/A

                          \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                        7. sub-divN/A

                          \[\leadsto \frac{t - x}{a - z} \cdot y \]
                        8. sub-negate-revN/A

                          \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                        9. lift--.f64N/A

                          \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                        10. lift--.f64N/A

                          \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                        11. sub-negate-revN/A

                          \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{\mathsf{neg}\left(\left(z - a\right)\right)} \cdot y \]
                        12. lift--.f64N/A

                          \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{\mathsf{neg}\left(\left(z - a\right)\right)} \cdot y \]
                        13. frac-2negN/A

                          \[\leadsto \frac{x - t}{z - a} \cdot y \]
                        14. lift-/.f6441.9

                          \[\leadsto \frac{x - t}{z - a} \cdot y \]
                      6. Applied rewrites41.9%

                        \[\leadsto \frac{x - t}{z - a} \cdot \color{blue}{y} \]
                      7. Taylor expanded in x around inf

                        \[\leadsto \frac{x \cdot y}{\color{blue}{z - a}} \]
                      8. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{x \cdot y}{z - \color{blue}{a}} \]
                        2. lower-*.f64N/A

                          \[\leadsto \frac{x \cdot y}{z - a} \]
                        3. lower--.f6421.1

                          \[\leadsto \frac{x \cdot y}{z - a} \]
                      9. Applied rewrites21.1%

                        \[\leadsto \frac{x \cdot y}{\color{blue}{z - a}} \]
                    7. Recombined 5 regimes into one program.
                    8. Add Preprocessing

                    Alternative 16: 43.3% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-31}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{-25}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
                    (FPCore (x y z t a)
                     :precision binary64
                     (if (<= z -1e-31) (+ x t) (if (<= z 5.3e-25) (* y (/ (- t x) a)) (+ x t))))
                    double code(double x, double y, double z, double t, double a) {
                    	double tmp;
                    	if (z <= -1e-31) {
                    		tmp = x + t;
                    	} else if (z <= 5.3e-25) {
                    		tmp = y * ((t - x) / a);
                    	} else {
                    		tmp = x + t;
                    	}
                    	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 <= (-1d-31)) then
                            tmp = x + t
                        else if (z <= 5.3d-25) then
                            tmp = y * ((t - x) / a)
                        else
                            tmp = x + t
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a) {
                    	double tmp;
                    	if (z <= -1e-31) {
                    		tmp = x + t;
                    	} else if (z <= 5.3e-25) {
                    		tmp = y * ((t - x) / a);
                    	} else {
                    		tmp = x + t;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t, a):
                    	tmp = 0
                    	if z <= -1e-31:
                    		tmp = x + t
                    	elif z <= 5.3e-25:
                    		tmp = y * ((t - x) / a)
                    	else:
                    		tmp = x + t
                    	return tmp
                    
                    function code(x, y, z, t, a)
                    	tmp = 0.0
                    	if (z <= -1e-31)
                    		tmp = Float64(x + t);
                    	elseif (z <= 5.3e-25)
                    		tmp = Float64(y * Float64(Float64(t - x) / a));
                    	else
                    		tmp = Float64(x + t);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t, a)
                    	tmp = 0.0;
                    	if (z <= -1e-31)
                    		tmp = x + t;
                    	elseif (z <= 5.3e-25)
                    		tmp = y * ((t - x) / a);
                    	else
                    		tmp = x + t;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e-31], N[(x + t), $MachinePrecision], If[LessEqual[z, 5.3e-25], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;z \leq -1 \cdot 10^{-31}:\\
                    \;\;\;\;x + t\\
                    
                    \mathbf{elif}\;z \leq 5.3 \cdot 10^{-25}:\\
                    \;\;\;\;y \cdot \frac{t - x}{a}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;x + t\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if z < -1e-31 or 5.2999999999999997e-25 < z

                      1. Initial program 80.4%

                        \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                      2. Taylor expanded in z around inf

                        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                      3. Step-by-step derivation
                        1. lower--.f6419.8

                          \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                      4. Applied rewrites19.8%

                        \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                      5. Taylor expanded in x around 0

                        \[\leadsto x + t \]
                      6. Step-by-step derivation
                        1. Applied rewrites33.7%

                          \[\leadsto x + t \]

                        if -1e-31 < z < 5.2999999999999997e-25

                        1. Initial program 80.4%

                          \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                        2. Taylor expanded in y around inf

                          \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                        3. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                          2. lower--.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                          3. lower-/.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                          4. lower--.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                          5. lower-/.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                          6. lower--.f6441.5

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                        4. Applied rewrites41.5%

                          \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                        5. Taylor expanded in a around inf

                          \[\leadsto y \cdot \frac{t - x}{\color{blue}{a}} \]
                        6. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto y \cdot \frac{t - x}{a} \]
                          2. lower--.f6425.8

                            \[\leadsto y \cdot \frac{t - x}{a} \]
                        7. Applied rewrites25.8%

                          \[\leadsto y \cdot \frac{t - x}{\color{blue}{a}} \]
                      7. Recombined 2 regimes into one program.
                      8. Add Preprocessing

                      Alternative 17: 40.2% accurate, 0.2× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;t\_1 \leq 10^{-231}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z - a}\\ \end{array} \end{array} \]
                      (FPCore (x y z t a)
                       :precision binary64
                       (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
                         (if (<= t_1 (- INFINITY))
                           (/ (* y (- x t)) z)
                           (if (<= t_1 -1e-295)
                             (+ x t)
                             (if (<= t_1 1e-231)
                               (* y (/ x z))
                               (if (<= t_1 4e+301) (+ x t) (/ (* x y) (- z a))))))))
                      double code(double x, double y, double z, double t, double a) {
                      	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                      	double tmp;
                      	if (t_1 <= -((double) INFINITY)) {
                      		tmp = (y * (x - t)) / z;
                      	} else if (t_1 <= -1e-295) {
                      		tmp = x + t;
                      	} else if (t_1 <= 1e-231) {
                      		tmp = y * (x / z);
                      	} else if (t_1 <= 4e+301) {
                      		tmp = x + t;
                      	} else {
                      		tmp = (x * y) / (z - a);
                      	}
                      	return tmp;
                      }
                      
                      public static double code(double x, double y, double z, double t, double a) {
                      	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                      	double tmp;
                      	if (t_1 <= -Double.POSITIVE_INFINITY) {
                      		tmp = (y * (x - t)) / z;
                      	} else if (t_1 <= -1e-295) {
                      		tmp = x + t;
                      	} else if (t_1 <= 1e-231) {
                      		tmp = y * (x / z);
                      	} else if (t_1 <= 4e+301) {
                      		tmp = x + t;
                      	} else {
                      		tmp = (x * y) / (z - a);
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a):
                      	t_1 = x + ((y - z) * ((t - x) / (a - z)))
                      	tmp = 0
                      	if t_1 <= -math.inf:
                      		tmp = (y * (x - t)) / z
                      	elif t_1 <= -1e-295:
                      		tmp = x + t
                      	elif t_1 <= 1e-231:
                      		tmp = y * (x / z)
                      	elif t_1 <= 4e+301:
                      		tmp = x + t
                      	else:
                      		tmp = (x * y) / (z - a)
                      	return tmp
                      
                      function code(x, y, z, t, a)
                      	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                      	tmp = 0.0
                      	if (t_1 <= Float64(-Inf))
                      		tmp = Float64(Float64(y * Float64(x - t)) / z);
                      	elseif (t_1 <= -1e-295)
                      		tmp = Float64(x + t);
                      	elseif (t_1 <= 1e-231)
                      		tmp = Float64(y * Float64(x / z));
                      	elseif (t_1 <= 4e+301)
                      		tmp = Float64(x + t);
                      	else
                      		tmp = Float64(Float64(x * y) / Float64(z - a));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a)
                      	t_1 = x + ((y - z) * ((t - x) / (a - z)));
                      	tmp = 0.0;
                      	if (t_1 <= -Inf)
                      		tmp = (y * (x - t)) / z;
                      	elseif (t_1 <= -1e-295)
                      		tmp = x + t;
                      	elseif (t_1 <= 1e-231)
                      		tmp = y * (x / z);
                      	elseif (t_1 <= 4e+301)
                      		tmp = x + t;
                      	else
                      		tmp = (x * y) / (z - a);
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, -1e-295], N[(x + t), $MachinePrecision], If[LessEqual[t$95$1, 1e-231], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+301], N[(x + t), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]]]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                      \mathbf{if}\;t\_1 \leq -\infty:\\
                      \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\
                      
                      \mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-295}:\\
                      \;\;\;\;x + t\\
                      
                      \mathbf{elif}\;t\_1 \leq 10^{-231}:\\
                      \;\;\;\;y \cdot \frac{x}{z}\\
                      
                      \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+301}:\\
                      \;\;\;\;x + t\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{x \cdot y}{z - a}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -inf.0

                        1. Initial program 80.4%

                          \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                        2. Taylor expanded in y around inf

                          \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                        3. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                          2. lower--.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                          3. lower-/.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                          4. lower--.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                          5. lower-/.f64N/A

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                          6. lower--.f6441.5

                            \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                        4. Applied rewrites41.5%

                          \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                        5. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                          2. *-commutativeN/A

                            \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
                          3. lower-*.f6441.5

                            \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
                          4. lift--.f64N/A

                            \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                          5. lift-/.f64N/A

                            \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                          6. lift-/.f64N/A

                            \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                          7. sub-divN/A

                            \[\leadsto \frac{t - x}{a - z} \cdot y \]
                          8. sub-negate-revN/A

                            \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                          9. lift--.f64N/A

                            \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                          10. lift--.f64N/A

                            \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                          11. sub-negate-revN/A

                            \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{\mathsf{neg}\left(\left(z - a\right)\right)} \cdot y \]
                          12. lift--.f64N/A

                            \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{\mathsf{neg}\left(\left(z - a\right)\right)} \cdot y \]
                          13. frac-2negN/A

                            \[\leadsto \frac{x - t}{z - a} \cdot y \]
                          14. lift-/.f6441.9

                            \[\leadsto \frac{x - t}{z - a} \cdot y \]
                        6. Applied rewrites41.9%

                          \[\leadsto \frac{x - t}{z - a} \cdot \color{blue}{y} \]
                        7. Taylor expanded in z around inf

                          \[\leadsto \frac{y \cdot \left(x - t\right)}{\color{blue}{z}} \]
                        8. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{y \cdot \left(x - t\right)}{z} \]
                          2. lower-*.f64N/A

                            \[\leadsto \frac{y \cdot \left(x - t\right)}{z} \]
                          3. lower--.f6423.8

                            \[\leadsto \frac{y \cdot \left(x - t\right)}{z} \]
                        9. Applied rewrites23.8%

                          \[\leadsto \frac{y \cdot \left(x - t\right)}{\color{blue}{z}} \]

                        if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000006e-295 or 9.9999999999999999e-232 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.00000000000000021e301

                        1. Initial program 80.4%

                          \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                        2. Taylor expanded in z around inf

                          \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                        3. Step-by-step derivation
                          1. lower--.f6419.8

                            \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                        4. Applied rewrites19.8%

                          \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                        5. Taylor expanded in x around 0

                          \[\leadsto x + t \]
                        6. Step-by-step derivation
                          1. Applied rewrites33.7%

                            \[\leadsto x + t \]

                          if -1.00000000000000006e-295 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 9.9999999999999999e-232

                          1. Initial program 80.4%

                            \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                          2. Taylor expanded in y around inf

                            \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                          3. Step-by-step derivation
                            1. lower-*.f64N/A

                              \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                            2. lower--.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                            3. lower-/.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                            4. lower--.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                            5. lower-/.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                            6. lower--.f6441.5

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                          4. Applied rewrites41.5%

                            \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                          5. Taylor expanded in z around -inf

                            \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\frac{t - x}{z}}\right) \]
                          6. Step-by-step derivation
                            1. lower-*.f64N/A

                              \[\leadsto y \cdot \left(-1 \cdot \frac{t - x}{\color{blue}{z}}\right) \]
                            2. lower-/.f64N/A

                              \[\leadsto y \cdot \left(-1 \cdot \frac{t - x}{z}\right) \]
                            3. lower--.f6425.6

                              \[\leadsto y \cdot \left(-1 \cdot \frac{t - x}{z}\right) \]
                          7. Applied rewrites25.6%

                            \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\frac{t - x}{z}}\right) \]
                          8. Taylor expanded in x around inf

                            \[\leadsto y \cdot \frac{x}{z} \]
                          9. Step-by-step derivation
                            1. lower-/.f6417.8

                              \[\leadsto y \cdot \frac{x}{z} \]
                          10. Applied rewrites17.8%

                            \[\leadsto y \cdot \frac{x}{z} \]

                          if 4.00000000000000021e301 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                          1. Initial program 80.4%

                            \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                          2. Taylor expanded in y around inf

                            \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                          3. Step-by-step derivation
                            1. lower-*.f64N/A

                              \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                            2. lower--.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                            3. lower-/.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                            4. lower--.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                            5. lower-/.f64N/A

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                            6. lower--.f6441.5

                              \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                          4. Applied rewrites41.5%

                            \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                          5. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                            2. *-commutativeN/A

                              \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
                            3. lower-*.f6441.5

                              \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot \color{blue}{y} \]
                            4. lift--.f64N/A

                              \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                            5. lift-/.f64N/A

                              \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                            6. lift-/.f64N/A

                              \[\leadsto \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \cdot y \]
                            7. sub-divN/A

                              \[\leadsto \frac{t - x}{a - z} \cdot y \]
                            8. sub-negate-revN/A

                              \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                            9. lift--.f64N/A

                              \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                            10. lift--.f64N/A

                              \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{a - z} \cdot y \]
                            11. sub-negate-revN/A

                              \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{\mathsf{neg}\left(\left(z - a\right)\right)} \cdot y \]
                            12. lift--.f64N/A

                              \[\leadsto \frac{\mathsf{neg}\left(\left(x - t\right)\right)}{\mathsf{neg}\left(\left(z - a\right)\right)} \cdot y \]
                            13. frac-2negN/A

                              \[\leadsto \frac{x - t}{z - a} \cdot y \]
                            14. lift-/.f6441.9

                              \[\leadsto \frac{x - t}{z - a} \cdot y \]
                          6. Applied rewrites41.9%

                            \[\leadsto \frac{x - t}{z - a} \cdot \color{blue}{y} \]
                          7. Taylor expanded in x around inf

                            \[\leadsto \frac{x \cdot y}{\color{blue}{z - a}} \]
                          8. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{x \cdot y}{z - \color{blue}{a}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{z - a} \]
                            3. lower--.f6421.1

                              \[\leadsto \frac{x \cdot y}{z - a} \]
                          9. Applied rewrites21.1%

                            \[\leadsto \frac{x \cdot y}{\color{blue}{z - a}} \]
                        7. Recombined 4 regimes into one program.
                        8. Add Preprocessing

                        Alternative 18: 37.9% accurate, 1.0× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{-139}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{t \cdot y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \end{array} \]
                        (FPCore (x y z t a)
                         :precision binary64
                         (if (<= z -3.3e-139) (+ x t) (if (<= z 6.2e-25) (/ (* t y) (- a z)) (+ x t))))
                        double code(double x, double y, double z, double t, double a) {
                        	double tmp;
                        	if (z <= -3.3e-139) {
                        		tmp = x + t;
                        	} else if (z <= 6.2e-25) {
                        		tmp = (t * y) / (a - z);
                        	} else {
                        		tmp = x + t;
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z, t, a)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            real(8), intent (in) :: a
                            real(8) :: tmp
                            if (z <= (-3.3d-139)) then
                                tmp = x + t
                            else if (z <= 6.2d-25) then
                                tmp = (t * y) / (a - z)
                            else
                                tmp = x + t
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double t, double a) {
                        	double tmp;
                        	if (z <= -3.3e-139) {
                        		tmp = x + t;
                        	} else if (z <= 6.2e-25) {
                        		tmp = (t * y) / (a - z);
                        	} else {
                        		tmp = x + t;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t, a):
                        	tmp = 0
                        	if z <= -3.3e-139:
                        		tmp = x + t
                        	elif z <= 6.2e-25:
                        		tmp = (t * y) / (a - z)
                        	else:
                        		tmp = x + t
                        	return tmp
                        
                        function code(x, y, z, t, a)
                        	tmp = 0.0
                        	if (z <= -3.3e-139)
                        		tmp = Float64(x + t);
                        	elseif (z <= 6.2e-25)
                        		tmp = Float64(Float64(t * y) / Float64(a - z));
                        	else
                        		tmp = Float64(x + t);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t, a)
                        	tmp = 0.0;
                        	if (z <= -3.3e-139)
                        		tmp = x + t;
                        	elseif (z <= 6.2e-25)
                        		tmp = (t * y) / (a - z);
                        	else
                        		tmp = x + t;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e-139], N[(x + t), $MachinePrecision], If[LessEqual[z, 6.2e-25], N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;z \leq -3.3 \cdot 10^{-139}:\\
                        \;\;\;\;x + t\\
                        
                        \mathbf{elif}\;z \leq 6.2 \cdot 10^{-25}:\\
                        \;\;\;\;\frac{t \cdot y}{a - z}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;x + t\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if z < -3.3e-139 or 6.19999999999999989e-25 < z

                          1. Initial program 80.4%

                            \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                          2. Taylor expanded in z around inf

                            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                          3. Step-by-step derivation
                            1. lower--.f6419.8

                              \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                          4. Applied rewrites19.8%

                            \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                          5. Taylor expanded in x around 0

                            \[\leadsto x + t \]
                          6. Step-by-step derivation
                            1. Applied rewrites33.7%

                              \[\leadsto x + t \]

                            if -3.3e-139 < z < 6.19999999999999989e-25

                            1. Initial program 80.4%

                              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                            2. Taylor expanded in y around inf

                              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                            3. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                              2. lower--.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                              3. lower-/.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                              4. lower--.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                              5. lower-/.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                              6. lower--.f6441.5

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                            4. Applied rewrites41.5%

                              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                            5. Taylor expanded in x around 0

                              \[\leadsto \frac{t \cdot y}{\color{blue}{a - z}} \]
                            6. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{t \cdot y}{a - \color{blue}{z}} \]
                              2. lower-*.f64N/A

                                \[\leadsto \frac{t \cdot y}{a - z} \]
                              3. lower--.f6421.3

                                \[\leadsto \frac{t \cdot y}{a - z} \]
                            7. Applied rewrites21.3%

                              \[\leadsto \frac{t \cdot y}{\color{blue}{a - z}} \]
                          7. Recombined 2 regimes into one program.
                          8. Add Preprocessing

                          Alternative 19: 35.4% accurate, 1.2× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{x}{z}\\ \mathbf{if}\;y \leq -1.04 \cdot 10^{+223}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+204}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (let* ((t_1 (* y (/ x z))))
                             (if (<= y -1.04e+223) t_1 (if (<= y 1.2e+204) (+ x t) t_1))))
                          double code(double x, double y, double z, double t, double a) {
                          	double t_1 = y * (x / z);
                          	double tmp;
                          	if (y <= -1.04e+223) {
                          		tmp = t_1;
                          	} else if (y <= 1.2e+204) {
                          		tmp = x + t;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(x, y, z, t, a)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8), intent (in) :: a
                              real(8) :: t_1
                              real(8) :: tmp
                              t_1 = y * (x / z)
                              if (y <= (-1.04d+223)) then
                                  tmp = t_1
                              else if (y <= 1.2d+204) then
                                  tmp = x + t
                              else
                                  tmp = t_1
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a) {
                          	double t_1 = y * (x / z);
                          	double tmp;
                          	if (y <= -1.04e+223) {
                          		tmp = t_1;
                          	} else if (y <= 1.2e+204) {
                          		tmp = x + t;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a):
                          	t_1 = y * (x / z)
                          	tmp = 0
                          	if y <= -1.04e+223:
                          		tmp = t_1
                          	elif y <= 1.2e+204:
                          		tmp = x + t
                          	else:
                          		tmp = t_1
                          	return tmp
                          
                          function code(x, y, z, t, a)
                          	t_1 = Float64(y * Float64(x / z))
                          	tmp = 0.0
                          	if (y <= -1.04e+223)
                          		tmp = t_1;
                          	elseif (y <= 1.2e+204)
                          		tmp = Float64(x + t);
                          	else
                          		tmp = t_1;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a)
                          	t_1 = y * (x / z);
                          	tmp = 0.0;
                          	if (y <= -1.04e+223)
                          		tmp = t_1;
                          	elseif (y <= 1.2e+204)
                          		tmp = x + t;
                          	else
                          		tmp = t_1;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.04e+223], t$95$1, If[LessEqual[y, 1.2e+204], N[(x + t), $MachinePrecision], t$95$1]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := y \cdot \frac{x}{z}\\
                          \mathbf{if}\;y \leq -1.04 \cdot 10^{+223}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;y \leq 1.2 \cdot 10^{+204}:\\
                          \;\;\;\;x + t\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if y < -1.04e223 or 1.2e204 < y

                            1. Initial program 80.4%

                              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                            2. Taylor expanded in y around inf

                              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                            3. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                              2. lower--.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \color{blue}{\frac{x}{a - z}}\right) \]
                              3. lower-/.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{\color{blue}{x}}{a - z}\right) \]
                              4. lower--.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right) \]
                              5. lower-/.f64N/A

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{\color{blue}{a - z}}\right) \]
                              6. lower--.f6441.5

                                \[\leadsto y \cdot \left(\frac{t}{a - z} - \frac{x}{a - \color{blue}{z}}\right) \]
                            4. Applied rewrites41.5%

                              \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
                            5. Taylor expanded in z around -inf

                              \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\frac{t - x}{z}}\right) \]
                            6. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto y \cdot \left(-1 \cdot \frac{t - x}{\color{blue}{z}}\right) \]
                              2. lower-/.f64N/A

                                \[\leadsto y \cdot \left(-1 \cdot \frac{t - x}{z}\right) \]
                              3. lower--.f6425.6

                                \[\leadsto y \cdot \left(-1 \cdot \frac{t - x}{z}\right) \]
                            7. Applied rewrites25.6%

                              \[\leadsto y \cdot \left(-1 \cdot \color{blue}{\frac{t - x}{z}}\right) \]
                            8. Taylor expanded in x around inf

                              \[\leadsto y \cdot \frac{x}{z} \]
                            9. Step-by-step derivation
                              1. lower-/.f6417.8

                                \[\leadsto y \cdot \frac{x}{z} \]
                            10. Applied rewrites17.8%

                              \[\leadsto y \cdot \frac{x}{z} \]

                            if -1.04e223 < y < 1.2e204

                            1. Initial program 80.4%

                              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                            2. Taylor expanded in z around inf

                              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                            3. Step-by-step derivation
                              1. lower--.f6419.8

                                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                            4. Applied rewrites19.8%

                              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                            5. Taylor expanded in x around 0

                              \[\leadsto x + t \]
                            6. Step-by-step derivation
                              1. Applied rewrites33.7%

                                \[\leadsto x + t \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 20: 33.7% accurate, 4.8× speedup?

                            \[\begin{array}{l} \\ x + t \end{array} \]
                            (FPCore (x y z t a) :precision binary64 (+ x t))
                            double code(double x, double y, double z, double t, double a) {
                            	return x + t;
                            }
                            
                            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 + t
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a) {
                            	return x + t;
                            }
                            
                            def code(x, y, z, t, a):
                            	return x + t
                            
                            function code(x, y, z, t, a)
                            	return Float64(x + t)
                            end
                            
                            function tmp = code(x, y, z, t, a)
                            	tmp = x + t;
                            end
                            
                            code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            x + t
                            \end{array}
                            
                            Derivation
                            1. Initial program 80.4%

                              \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
                            2. Taylor expanded in z around inf

                              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                            3. Step-by-step derivation
                              1. lower--.f6419.8

                                \[\leadsto x + \left(t - \color{blue}{x}\right) \]
                            4. Applied rewrites19.8%

                              \[\leadsto x + \color{blue}{\left(t - x\right)} \]
                            5. Taylor expanded in x around 0

                              \[\leadsto x + t \]
                            6. Step-by-step derivation
                              1. Applied rewrites33.7%

                                \[\leadsto x + t \]
                              2. Add Preprocessing

                              Reproduce

                              ?
                              herbie shell --seed 2025149 
                              (FPCore (x y z t a)
                                :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
                                :precision binary64
                                (+ x (* (- y z) (/ (- t x) (- a z)))))