Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.5% → 94.4%
Time: 4.1s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 79.5% 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.4% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x + t\_1 \cdot \left(t - 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)))) < -1.00000000000000007e-229

    1. Initial program 79.5%

      \[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. add-flipN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
      11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 79.5%

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

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

      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 79.5%

      \[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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{z}, a - y, 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)))) < -1.00000000000000007e-229 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 79.5%

      \[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. add-flipN/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
      11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 79.5%

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

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

      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\

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


\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)))) < -1.00000000000000007e-229 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306

    1. Initial program 79.5%

      \[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. add-flipN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - x}{a - z}}, y - z, x\right) \]
      10. 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) \]
      11. 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) \]
      12. 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) \]
      13. 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) \]
      14. lower--.f64N/A

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

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

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

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

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

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

    1. Initial program 79.5%

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

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

      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 79.5%

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

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

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

Alternative 4: 79.3% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-229}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\

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


\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)))) < -2.00000000000000014e246

    1. Initial program 79.5%

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

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

      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000014e246 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000007e-229 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 79.5%

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

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

        \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 79.5%

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

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

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

    Alternative 5: 77.9% accurate, 0.8× speedup?

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

      1. Initial program 79.5%

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

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

        if -5.7000000000000003e-49 < a < 1.55e-7

        1. Initial program 79.5%

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

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

          \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 77.4% accurate, 0.8× speedup?

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

        1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -3.4499999999999998e-40 < a < 1.5e6

          1. Initial program 79.5%

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

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

            \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.5e6 < a

          1. Initial program 79.5%

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

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

          Alternative 7: 75.1% accurate, 0.8× speedup?

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

            1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -3.4499999999999998e-40 < a < 1.5e6

              1. Initial program 79.5%

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

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

                \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 8: 71.6% accurate, 0.8× speedup?

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

              1. Initial program 79.5%

                \[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. add-flipN/A

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
                11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -5.7000000000000003e-49 < a < 9.6e23

              1. Initial program 79.5%

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

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

                \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 9.6e23 < a

              1. Initial program 79.5%

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

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

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

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

                Alternative 9: 70.2% accurate, 0.9× speedup?

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

                  1. Initial program 79.5%

                    \[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. add-flipN/A

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
                    11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -5.50000000000000031e-49 < a < 9.6e23

                  1. Initial program 79.5%

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

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

                    \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 9.6e23 < a

                  1. Initial program 79.5%

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

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

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

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

                    Alternative 10: 70.2% accurate, 0.9× speedup?

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

                      1. Initial program 79.5%

                        \[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. add-flipN/A

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
                        11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -5.50000000000000031e-49 < a < 1.4999999999999999e-7

                      1. Initial program 79.5%

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

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

                        \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 1.4999999999999999e-7 < a

                      1. Initial program 79.5%

                        \[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. add-flipN/A

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
                        11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 11: 69.9% accurate, 0.9× speedup?

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

                      1. Initial program 79.5%

                        \[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. add-flipN/A

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
                        11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -5.50000000000000031e-49 < a < 1.4999999999999999e-7

                      1. Initial program 79.5%

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

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

                        \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 12: 63.6% accurate, 0.9× speedup?

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

                      1. Initial program 79.5%

                        \[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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto x + \frac{y \cdot t}{a} \]
                      8. Step-by-step derivation
                        1. Applied rewrites37.8%

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

                        if -6.00000000000000039e-40 < a < 9.5999999999999997e36

                        1. Initial program 79.5%

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

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

                          \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 49.4% accurate, 1.0× speedup?

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

                        1. Initial program 79.5%

                          \[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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto x + \frac{y \cdot t}{a} \]
                        8. Step-by-step derivation
                          1. Applied rewrites37.8%

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

                          if -1.06e-40 < a < 1.19999999999999994e-12

                          1. Initial program 79.5%

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

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

                            \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(x - t, \color{blue}{\frac{y - a}{z}}, t\right) \]
                          7. Taylor expanded in y 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.5

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

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

                        Alternative 14: 45.9% accurate, 0.2× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(x - t\right)}{z}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-229}:\\ \;\;\;\;t + x\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                        (FPCore (x y z t a)
                         :precision binary64
                         (let* ((t_1 (/ (* y (- x t)) z)) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
                           (if (<= t_2 (- INFINITY))
                             t_1
                             (if (<= t_2 -1e-229)
                               (+ t x)
                               (if (<= t_2 0.0)
                                 (/ (* x (- y a)) z)
                                 (if (<= t_2 5e+306) (+ t x) t_1))))))
                        double code(double x, double y, double z, double t, double a) {
                        	double t_1 = (y * (x - t)) / z;
                        	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                        	double tmp;
                        	if (t_2 <= -((double) INFINITY)) {
                        		tmp = t_1;
                        	} else if (t_2 <= -1e-229) {
                        		tmp = t + x;
                        	} else if (t_2 <= 0.0) {
                        		tmp = (x * (y - a)) / z;
                        	} else if (t_2 <= 5e+306) {
                        		tmp = t + x;
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        public static double code(double x, double y, double z, double t, double a) {
                        	double t_1 = (y * (x - t)) / z;
                        	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                        	double tmp;
                        	if (t_2 <= -Double.POSITIVE_INFINITY) {
                        		tmp = t_1;
                        	} else if (t_2 <= -1e-229) {
                        		tmp = t + x;
                        	} else if (t_2 <= 0.0) {
                        		tmp = (x * (y - a)) / z;
                        	} else if (t_2 <= 5e+306) {
                        		tmp = t + x;
                        	} else {
                        		tmp = t_1;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t, a):
                        	t_1 = (y * (x - t)) / z
                        	t_2 = x + ((y - z) * ((t - x) / (a - z)))
                        	tmp = 0
                        	if t_2 <= -math.inf:
                        		tmp = t_1
                        	elif t_2 <= -1e-229:
                        		tmp = t + x
                        	elif t_2 <= 0.0:
                        		tmp = (x * (y - a)) / z
                        	elif t_2 <= 5e+306:
                        		tmp = t + x
                        	else:
                        		tmp = t_1
                        	return tmp
                        
                        function code(x, y, z, t, a)
                        	t_1 = Float64(Float64(y * Float64(x - t)) / z)
                        	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                        	tmp = 0.0
                        	if (t_2 <= Float64(-Inf))
                        		tmp = t_1;
                        	elseif (t_2 <= -1e-229)
                        		tmp = Float64(t + x);
                        	elseif (t_2 <= 0.0)
                        		tmp = Float64(Float64(x * Float64(y - a)) / z);
                        	elseif (t_2 <= 5e+306)
                        		tmp = Float64(t + x);
                        	else
                        		tmp = t_1;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t, a)
                        	t_1 = (y * (x - t)) / z;
                        	t_2 = x + ((y - z) * ((t - x) / (a - z)));
                        	tmp = 0.0;
                        	if (t_2 <= -Inf)
                        		tmp = t_1;
                        	elseif (t_2 <= -1e-229)
                        		tmp = t + x;
                        	elseif (t_2 <= 0.0)
                        		tmp = (x * (y - a)) / z;
                        	elseif (t_2 <= 5e+306)
                        		tmp = t + x;
                        	else
                        		tmp = t_1;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $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, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-229], N[(t + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$2, 5e+306], N[(t + x), $MachinePrecision], t$95$1]]]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \frac{y \cdot \left(x - t\right)}{z}\\
                        t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                        \mathbf{if}\;t\_2 \leq -\infty:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-229}:\\
                        \;\;\;\;t + x\\
                        
                        \mathbf{elif}\;t\_2 \leq 0:\\
                        \;\;\;\;\frac{x \cdot \left(y - a\right)}{z}\\
                        
                        \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
                        \;\;\;\;t + x\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \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)))) < -inf.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                          1. Initial program 79.5%

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

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

                            \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(x - t, \color{blue}{\frac{y - a}{z}}, t\right) \]
                          7. Taylor expanded in y 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.5

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

                            \[\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.00000000000000007e-229 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306

                          1. Initial program 79.5%

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

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

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

                            \[\leadsto x + -1 \cdot \color{blue}{x} \]
                          6. Step-by-step derivation
                            1. lower-*.f642.8

                              \[\leadsto x + -1 \cdot x \]
                          7. Applied rewrites2.8%

                            \[\leadsto x + -1 \cdot \color{blue}{x} \]
                          8. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \color{blue}{x + -1 \cdot x} \]
                            2. +-commutativeN/A

                              \[\leadsto \color{blue}{-1 \cdot x + x} \]
                            3. lower-+.f642.8

                              \[\leadsto \color{blue}{-1 \cdot x + x} \]
                            4. lift--.f64N/A

                              \[\leadsto -1 \cdot x + x \]
                            5. lift--.f64N/A

                              \[\leadsto -1 \cdot x + x \]
                            6. associate-*r/N/A

                              \[\leadsto \color{blue}{-1} \cdot x + x \]
                            7. associate-*l/N/A

                              \[\leadsto \color{blue}{-1} \cdot x + x \]
                            8. frac-2neg-revN/A

                              \[\leadsto -1 \cdot x + x \]
                            9. sub-negate-revN/A

                              \[\leadsto -1 \cdot x + x \]
                            10. lift--.f64N/A

                              \[\leadsto -1 \cdot x + x \]
                            11. sub-negate-revN/A

                              \[\leadsto -1 \cdot x + x \]
                            12. lift--.f642.8

                              \[\leadsto -1 \cdot x + x \]
                            13. lift-*.f64N/A

                              \[\leadsto -1 \cdot x + x \]
                            14. mul-1-negN/A

                              \[\leadsto \left(\mathsf{neg}\left(x\right)\right) + x \]
                            15. lower-neg.f642.8

                              \[\leadsto \left(-x\right) + x \]
                          9. Applied rewrites2.8%

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

                            \[\leadsto t + x \]
                          11. Step-by-step derivation
                            1. Applied rewrites35.4%

                              \[\leadsto t + x \]

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

                            1. Initial program 79.5%

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

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

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

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

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

                          Alternative 15: 45.9% accurate, 0.2× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{x \cdot \left(y - a\right)}{z}\\ t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-229}:\\ \;\;\;\;t + x\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (let* ((t_1 (/ (* x (- y a)) z)) (t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
                             (if (<= t_2 (- INFINITY))
                               t_1
                               (if (<= t_2 -1e-229)
                                 (+ t x)
                                 (if (<= t_2 0.0) t_1 (if (<= t_2 5e+306) (+ t x) t_1))))))
                          double code(double x, double y, double z, double t, double a) {
                          	double t_1 = (x * (y - a)) / z;
                          	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                          	double tmp;
                          	if (t_2 <= -((double) INFINITY)) {
                          		tmp = t_1;
                          	} else if (t_2 <= -1e-229) {
                          		tmp = t + x;
                          	} else if (t_2 <= 0.0) {
                          		tmp = t_1;
                          	} else if (t_2 <= 5e+306) {
                          		tmp = t + x;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          public static double code(double x, double y, double z, double t, double a) {
                          	double t_1 = (x * (y - a)) / z;
                          	double t_2 = x + ((y - z) * ((t - x) / (a - z)));
                          	double tmp;
                          	if (t_2 <= -Double.POSITIVE_INFINITY) {
                          		tmp = t_1;
                          	} else if (t_2 <= -1e-229) {
                          		tmp = t + x;
                          	} else if (t_2 <= 0.0) {
                          		tmp = t_1;
                          	} else if (t_2 <= 5e+306) {
                          		tmp = t + x;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a):
                          	t_1 = (x * (y - a)) / z
                          	t_2 = x + ((y - z) * ((t - x) / (a - z)))
                          	tmp = 0
                          	if t_2 <= -math.inf:
                          		tmp = t_1
                          	elif t_2 <= -1e-229:
                          		tmp = t + x
                          	elif t_2 <= 0.0:
                          		tmp = t_1
                          	elif t_2 <= 5e+306:
                          		tmp = t + x
                          	else:
                          		tmp = t_1
                          	return tmp
                          
                          function code(x, y, z, t, a)
                          	t_1 = Float64(Float64(x * Float64(y - a)) / z)
                          	t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                          	tmp = 0.0
                          	if (t_2 <= Float64(-Inf))
                          		tmp = t_1;
                          	elseif (t_2 <= -1e-229)
                          		tmp = Float64(t + x);
                          	elseif (t_2 <= 0.0)
                          		tmp = t_1;
                          	elseif (t_2 <= 5e+306)
                          		tmp = Float64(t + x);
                          	else
                          		tmp = t_1;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a)
                          	t_1 = (x * (y - a)) / z;
                          	t_2 = x + ((y - z) * ((t - x) / (a - z)));
                          	tmp = 0.0;
                          	if (t_2 <= -Inf)
                          		tmp = t_1;
                          	elseif (t_2 <= -1e-229)
                          		tmp = t + x;
                          	elseif (t_2 <= 0.0)
                          		tmp = t_1;
                          	elseif (t_2 <= 5e+306)
                          		tmp = t + x;
                          	else
                          		tmp = t_1;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $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, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -1e-229], N[(t + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+306], N[(t + x), $MachinePrecision], t$95$1]]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := \frac{x \cdot \left(y - a\right)}{z}\\
                          t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                          \mathbf{if}\;t\_2 \leq -\infty:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-229}:\\
                          \;\;\;\;t + x\\
                          
                          \mathbf{elif}\;t\_2 \leq 0:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+306}:\\
                          \;\;\;\;t + x\\
                          
                          \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)))) < -inf.0 or -1.00000000000000007e-229 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                            1. Initial program 79.5%

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

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

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

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

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

                            if -inf.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000007e-229 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306

                            1. Initial program 79.5%

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

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

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

                              \[\leadsto x + -1 \cdot \color{blue}{x} \]
                            6. Step-by-step derivation
                              1. lower-*.f642.8

                                \[\leadsto x + -1 \cdot x \]
                            7. Applied rewrites2.8%

                              \[\leadsto x + -1 \cdot \color{blue}{x} \]
                            8. Step-by-step derivation
                              1. lift-+.f64N/A

                                \[\leadsto \color{blue}{x + -1 \cdot x} \]
                              2. +-commutativeN/A

                                \[\leadsto \color{blue}{-1 \cdot x + x} \]
                              3. lower-+.f642.8

                                \[\leadsto \color{blue}{-1 \cdot x + x} \]
                              4. lift--.f64N/A

                                \[\leadsto -1 \cdot x + x \]
                              5. lift--.f64N/A

                                \[\leadsto -1 \cdot x + x \]
                              6. associate-*r/N/A

                                \[\leadsto \color{blue}{-1} \cdot x + x \]
                              7. associate-*l/N/A

                                \[\leadsto \color{blue}{-1} \cdot x + x \]
                              8. frac-2neg-revN/A

                                \[\leadsto -1 \cdot x + x \]
                              9. sub-negate-revN/A

                                \[\leadsto -1 \cdot x + x \]
                              10. lift--.f64N/A

                                \[\leadsto -1 \cdot x + x \]
                              11. sub-negate-revN/A

                                \[\leadsto -1 \cdot x + x \]
                              12. lift--.f642.8

                                \[\leadsto -1 \cdot x + x \]
                              13. lift-*.f64N/A

                                \[\leadsto -1 \cdot x + x \]
                              14. mul-1-negN/A

                                \[\leadsto \left(\mathsf{neg}\left(x\right)\right) + x \]
                              15. lower-neg.f642.8

                                \[\leadsto \left(-x\right) + x \]
                            9. Applied rewrites2.8%

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

                              \[\leadsto t + x \]
                            11. Step-by-step derivation
                              1. Applied rewrites35.4%

                                \[\leadsto t + x \]
                            12. Recombined 2 regimes into one program.
                            13. Add Preprocessing

                            Alternative 16: 39.6% accurate, 0.3× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ t_2 := x \cdot \frac{t}{x}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-229}:\\ \;\;\;\;t + x\\ \mathbf{elif}\;t\_1 \leq 10^{-182}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t + x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                            (FPCore (x y z t a)
                             :precision binary64
                             (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))) (t_2 (* x (/ t x))))
                               (if (<= t_1 -1e-229)
                                 (+ t x)
                                 (if (<= t_1 1e-182) t_2 (if (<= t_1 5e+306) (+ t x) t_2)))))
                            double code(double x, double y, double z, double t, double a) {
                            	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                            	double t_2 = x * (t / x);
                            	double tmp;
                            	if (t_1 <= -1e-229) {
                            		tmp = t + x;
                            	} else if (t_1 <= 1e-182) {
                            		tmp = t_2;
                            	} else if (t_1 <= 5e+306) {
                            		tmp = t + x;
                            	} else {
                            		tmp = t_2;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z, t, a)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                real(8), intent (in) :: a
                                real(8) :: t_1
                                real(8) :: t_2
                                real(8) :: tmp
                                t_1 = x + ((y - z) * ((t - x) / (a - z)))
                                t_2 = x * (t / x)
                                if (t_1 <= (-1d-229)) then
                                    tmp = t + x
                                else if (t_1 <= 1d-182) then
                                    tmp = t_2
                                else if (t_1 <= 5d+306) then
                                    tmp = t + x
                                else
                                    tmp = t_2
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z, double t, double a) {
                            	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
                            	double t_2 = x * (t / x);
                            	double tmp;
                            	if (t_1 <= -1e-229) {
                            		tmp = t + x;
                            	} else if (t_1 <= 1e-182) {
                            		tmp = t_2;
                            	} else if (t_1 <= 5e+306) {
                            		tmp = t + x;
                            	} else {
                            		tmp = t_2;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z, t, a):
                            	t_1 = x + ((y - z) * ((t - x) / (a - z)))
                            	t_2 = x * (t / x)
                            	tmp = 0
                            	if t_1 <= -1e-229:
                            		tmp = t + x
                            	elif t_1 <= 1e-182:
                            		tmp = t_2
                            	elif t_1 <= 5e+306:
                            		tmp = t + x
                            	else:
                            		tmp = t_2
                            	return tmp
                            
                            function code(x, y, z, t, a)
                            	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
                            	t_2 = Float64(x * Float64(t / x))
                            	tmp = 0.0
                            	if (t_1 <= -1e-229)
                            		tmp = Float64(t + x);
                            	elseif (t_1 <= 1e-182)
                            		tmp = t_2;
                            	elseif (t_1 <= 5e+306)
                            		tmp = Float64(t + x);
                            	else
                            		tmp = t_2;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z, t, a)
                            	t_1 = x + ((y - z) * ((t - x) / (a - z)));
                            	t_2 = x * (t / x);
                            	tmp = 0.0;
                            	if (t_1 <= -1e-229)
                            		tmp = t + x;
                            	elseif (t_1 <= 1e-182)
                            		tmp = t_2;
                            	elseif (t_1 <= 5e+306)
                            		tmp = t + x;
                            	else
                            		tmp = t_2;
                            	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]}, Block[{t$95$2 = N[(x * N[(t / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-229], N[(t + x), $MachinePrecision], If[LessEqual[t$95$1, 1e-182], t$95$2, If[LessEqual[t$95$1, 5e+306], N[(t + x), $MachinePrecision], t$95$2]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
                            t_2 := x \cdot \frac{t}{x}\\
                            \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-229}:\\
                            \;\;\;\;t + x\\
                            
                            \mathbf{elif}\;t\_1 \leq 10^{-182}:\\
                            \;\;\;\;t\_2\\
                            
                            \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
                            \;\;\;\;t + x\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_2\\
                            
                            
                            \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)))) < -1.00000000000000007e-229 or 1e-182 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4.99999999999999993e306

                              1. Initial program 79.5%

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

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

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

                                \[\leadsto x + -1 \cdot \color{blue}{x} \]
                              6. Step-by-step derivation
                                1. lower-*.f642.8

                                  \[\leadsto x + -1 \cdot x \]
                              7. Applied rewrites2.8%

                                \[\leadsto x + -1 \cdot \color{blue}{x} \]
                              8. Step-by-step derivation
                                1. lift-+.f64N/A

                                  \[\leadsto \color{blue}{x + -1 \cdot x} \]
                                2. +-commutativeN/A

                                  \[\leadsto \color{blue}{-1 \cdot x + x} \]
                                3. lower-+.f642.8

                                  \[\leadsto \color{blue}{-1 \cdot x + x} \]
                                4. lift--.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                5. lift--.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                6. associate-*r/N/A

                                  \[\leadsto \color{blue}{-1} \cdot x + x \]
                                7. associate-*l/N/A

                                  \[\leadsto \color{blue}{-1} \cdot x + x \]
                                8. frac-2neg-revN/A

                                  \[\leadsto -1 \cdot x + x \]
                                9. sub-negate-revN/A

                                  \[\leadsto -1 \cdot x + x \]
                                10. lift--.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                11. sub-negate-revN/A

                                  \[\leadsto -1 \cdot x + x \]
                                12. lift--.f642.8

                                  \[\leadsto -1 \cdot x + x \]
                                13. lift-*.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                14. mul-1-negN/A

                                  \[\leadsto \left(\mathsf{neg}\left(x\right)\right) + x \]
                                15. lower-neg.f642.8

                                  \[\leadsto \left(-x\right) + x \]
                              9. Applied rewrites2.8%

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

                                \[\leadsto t + x \]
                              11. Step-by-step derivation
                                1. Applied rewrites35.4%

                                  \[\leadsto t + x \]

                                if -1.00000000000000007e-229 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-182 or 4.99999999999999993e306 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

                                1. Initial program 79.5%

                                  \[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. add-flipN/A

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\left(\frac{1}{a - z} \cdot \left(y - z\right)\right) \cdot \left(t - x\right)} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \]
                                  11. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto x \cdot \frac{t}{\color{blue}{x}} \]
                                8. Step-by-step derivation
                                  1. lower-/.f6422.8

                                    \[\leadsto x \cdot \frac{t}{x} \]
                                9. Applied rewrites22.8%

                                  \[\leadsto x \cdot \frac{t}{\color{blue}{x}} \]
                              12. Recombined 2 regimes into one program.
                              13. Add Preprocessing

                              Alternative 17: 35.4% accurate, 4.8× speedup?

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

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

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

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

                                \[\leadsto x + -1 \cdot \color{blue}{x} \]
                              6. Step-by-step derivation
                                1. lower-*.f642.8

                                  \[\leadsto x + -1 \cdot x \]
                              7. Applied rewrites2.8%

                                \[\leadsto x + -1 \cdot \color{blue}{x} \]
                              8. Step-by-step derivation
                                1. lift-+.f64N/A

                                  \[\leadsto \color{blue}{x + -1 \cdot x} \]
                                2. +-commutativeN/A

                                  \[\leadsto \color{blue}{-1 \cdot x + x} \]
                                3. lower-+.f642.8

                                  \[\leadsto \color{blue}{-1 \cdot x + x} \]
                                4. lift--.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                5. lift--.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                6. associate-*r/N/A

                                  \[\leadsto \color{blue}{-1} \cdot x + x \]
                                7. associate-*l/N/A

                                  \[\leadsto \color{blue}{-1} \cdot x + x \]
                                8. frac-2neg-revN/A

                                  \[\leadsto -1 \cdot x + x \]
                                9. sub-negate-revN/A

                                  \[\leadsto -1 \cdot x + x \]
                                10. lift--.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                11. sub-negate-revN/A

                                  \[\leadsto -1 \cdot x + x \]
                                12. lift--.f642.8

                                  \[\leadsto -1 \cdot x + x \]
                                13. lift-*.f64N/A

                                  \[\leadsto -1 \cdot x + x \]
                                14. mul-1-negN/A

                                  \[\leadsto \left(\mathsf{neg}\left(x\right)\right) + x \]
                                15. lower-neg.f642.8

                                  \[\leadsto \left(-x\right) + x \]
                              9. Applied rewrites2.8%

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

                                \[\leadsto t + x \]
                              11. Step-by-step derivation
                                1. Applied rewrites35.4%

                                  \[\leadsto t + x \]
                                2. Add Preprocessing

                                Reproduce

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