Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.1% → 91.7%
Time: 6.7s
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}

Sampling outcomes in binary64 precision:

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: 80.1% 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: 91.7% accurate, 0.2× speedup?

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

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \left(\left(1 - \frac{y - z}{a - z}\right) + \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}\right)\\

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


\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)))) < -4.99999999999999979e-234

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 6.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)} \]
    5. 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}} \]
    6. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-234}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a - z} - \frac{x}{a - z}, y - z, x\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0:\\ \;\;\;\;t + \left(-x\right) \cdot \frac{a - y}{z}\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 5 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \left(\left(1 - \frac{y - z}{a - z}\right) + \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 90.4% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 6.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)} \]
    5. 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}} \]
    6. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-234} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \left(-x\right) \cdot \frac{a - y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 88.8% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 6.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)} \]
    5. 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}} \]
    6. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-234} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x \cdot \left(y - a\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 90.2% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 6.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)} \]
    5. 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}} \]
    6. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-234}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{a - z} - \frac{x}{a - z}, y - z, x\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0:\\ \;\;\;\;t + \left(-x\right) \cdot \frac{a - y}{z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq 6 \cdot 10^{-78}:\\
\;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\

\mathbf{elif}\;a \leq 1.35 \cdot 10^{+82}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -9.00000000000000017e-90

    1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

    if -9.00000000000000017e-90 < a < 5.99999999999999975e-78

    1. Initial program 69.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999975e-78 < a < 1.35e82

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{y - z}{\color{blue}{a} - z} \]
      5. lift--.f6472.3

        \[\leadsto t \cdot \frac{y - z}{a - \color{blue}{z}} \]
    7. Applied rewrites72.3%

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

    if 1.35e82 < a

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9 \cdot 10^{-90}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-78}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+82}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 66.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -4 \cdot 10^{-68}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.3499999999999999e148 or 5.79999999999999971e80 < a

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

    if -2.3499999999999999e148 < a < -4.00000000000000027e-68

    1. Initial program 64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \frac{y - z}{\color{blue}{a} - z} \]
      5. lift--.f6456.9

        \[\leadsto t \cdot \frac{y - z}{a - \color{blue}{z}} \]
    7. Applied rewrites56.9%

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

    if -4.00000000000000027e-68 < a < 5.79999999999999971e80

    1. Initial program 73.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t - x\right) \cdot \frac{y - z}{z}, -1, x\right) \]
      8. lift--.f6463.5

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

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

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

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

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

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

        \[\leadsto -\frac{y \cdot \left(t - x\right)}{z} \]
      5. lift--.f6446.2

        \[\leadsto -\frac{y \cdot \left(t - x\right)}{z} \]
    8. Applied rewrites46.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.35 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-68}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+80}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{t - x}{z}, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -0.088:\\
\;\;\;\;\left(-x\right) \cdot \frac{a - y}{z}\\

\mathbf{elif}\;a \leq 400000:\\
\;\;\;\;\left(-t\right) \cdot \left(\frac{y}{z} - 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.8e119 or 4e5 < a

    1. Initial program 93.2%

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

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

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

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

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

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

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

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

    if -4.8e119 < a < -0.087999999999999995

    1. Initial program 51.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)} \]
    5. 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}} \]
    6. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(x \cdot \frac{a - y}{z}\right) \]
      5. lower--.f6450.7

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.087999999999999995 < a < 4e5

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -t \cdot \left(\frac{y}{z} - 1\right) \]
      5. lower-/.f6455.9

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

      \[\leadsto -t \cdot \left(\frac{y}{z} - 1\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.8 \cdot 10^{+119}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{elif}\;a \leq -0.088:\\ \;\;\;\;\left(-x\right) \cdot \frac{a - y}{z}\\ \mathbf{elif}\;a \leq 400000:\\ \;\;\;\;\left(-t\right) \cdot \left(\frac{y}{z} - 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 71.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.1 \cdot 10^{-91}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-44}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a - z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -4.1e-91)
   (+ x (* (- y z) (/ t (- a z))))
   (if (<= a 9.5e-44)
     (- t (/ (* y (- t x)) z))
     (+ x (* y (/ (- t x) (- a z)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -4.1e-91) {
		tmp = x + ((y - z) * (t / (a - z)));
	} else if (a <= 9.5e-44) {
		tmp = t - ((y * (t - x)) / z);
	} else {
		tmp = x + (y * ((t - x) / (a - z)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-4.1d-91)) then
        tmp = x + ((y - z) * (t / (a - z)))
    else if (a <= 9.5d-44) then
        tmp = t - ((y * (t - x)) / z)
    else
        tmp = x + (y * ((t - x) / (a - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -4.1e-91) {
		tmp = x + ((y - z) * (t / (a - z)));
	} else if (a <= 9.5e-44) {
		tmp = t - ((y * (t - x)) / z);
	} else {
		tmp = x + (y * ((t - x) / (a - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -4.1e-91:
		tmp = x + ((y - z) * (t / (a - z)))
	elif a <= 9.5e-44:
		tmp = t - ((y * (t - x)) / z)
	else:
		tmp = x + (y * ((t - x) / (a - z)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -4.1e-91)
		tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z))));
	elseif (a <= 9.5e-44)
		tmp = Float64(t - Float64(Float64(y * Float64(t - x)) / z));
	else
		tmp = Float64(x + Float64(y * Float64(Float64(t - x) / Float64(a - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -4.1e-91)
		tmp = x + ((y - z) * (t / (a - z)));
	elseif (a <= 9.5e-44)
		tmp = t - ((y * (t - x)) / z);
	else
		tmp = x + (y * ((t - x) / (a - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.1e-91], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-44], N[(t - N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{-91}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-44}:\\
\;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.10000000000000024e-91

    1. Initial program 80.5%

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

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

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

      if -4.10000000000000024e-91 < a < 9.49999999999999924e-44

      1. Initial program 69.7%

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(t - x\right) \cdot \frac{y - z}{z}, -1, x\right) \]
        8. lift--.f6468.0

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

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

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

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

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

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

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

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

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

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

      if 9.49999999999999924e-44 < a

      1. Initial program 91.0%

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

        \[\leadsto x + \color{blue}{y} \cdot \frac{t - x}{a - z} \]
      4. Step-by-step derivation
        1. Applied rewrites81.5%

          \[\leadsto x + \color{blue}{y} \cdot \frac{t - x}{a - z} \]
      5. Recombined 3 regimes into one program.
      6. Final simplification80.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.1 \cdot 10^{-91}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-44}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a - z}\\ \end{array} \]
      7. Add Preprocessing

      Alternative 9: 69.8% accurate, 0.8× speedup?

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

        1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

        if -9.00000000000000017e-90 < a < 9.49999999999999924e-44

        1. Initial program 69.7%

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(t - x\right) \cdot \frac{y - z}{z}, -1, x\right) \]
          8. lift--.f6468.0

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

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

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

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

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

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

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

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

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

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

        if 9.49999999999999924e-44 < a

        1. Initial program 91.0%

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

          \[\leadsto x + \color{blue}{y} \cdot \frac{t - x}{a - z} \]
        4. Step-by-step derivation
          1. Applied rewrites81.5%

            \[\leadsto x + \color{blue}{y} \cdot \frac{t - x}{a - z} \]
        5. Recombined 3 regimes into one program.
        6. Final simplification78.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9 \cdot 10^{-90}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a}, x\right)\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-44}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a - z}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 10: 65.9% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.8 \cdot 10^{+119} \lor \neg \left(a \leq 5.8 \cdot 10^{+80}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{t - x}{z}, t\right)\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (or (<= a -4.8e+119) (not (<= a 5.8e+80)))
           (fma y (/ (- t x) a) x)
           (fma (- y) (/ (- t x) z) t)))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if ((a <= -4.8e+119) || !(a <= 5.8e+80)) {
        		tmp = fma(y, ((t - x) / a), x);
        	} else {
        		tmp = fma(-y, ((t - x) / z), t);
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if ((a <= -4.8e+119) || !(a <= 5.8e+80))
        		tmp = fma(y, Float64(Float64(t - x) / a), x);
        	else
        		tmp = fma(Float64(-y), Float64(Float64(t - x) / z), t);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e+119], N[Not[LessEqual[a, 5.8e+80]], $MachinePrecision]], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[((-y) * N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] + t), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a \leq -4.8 \cdot 10^{+119} \lor \neg \left(a \leq 5.8 \cdot 10^{+80}\right):\\
        \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(-y, \frac{t - x}{z}, t\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -4.8e119 or 5.79999999999999971e80 < a

          1. Initial program 95.0%

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

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

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

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

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

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

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

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

          if -4.8e119 < a < 5.79999999999999971e80

          1. Initial program 70.4%

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(t - x\right) \cdot \frac{y - z}{z}, -1, x\right) \]
            8. lift--.f6456.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.8 \cdot 10^{+119} \lor \neg \left(a \leq 5.8 \cdot 10^{+80}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{t - x}{z}, t\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 11: 51.3% accurate, 0.8× speedup?

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

          1. Initial program 58.3%

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

            \[\leadsto \color{blue}{t} \]
          4. Step-by-step derivation
            1. Applied rewrites41.7%

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

            if -1.35e82 < z < 1.1600000000000001e58

            1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

              if 1.1600000000000001e58 < z < 3.89999999999999971e157

              1. Initial program 84.0%

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(t - x\right) \cdot \frac{y - z}{z}, -1, x\right) \]
                8. lift--.f6468.3

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

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

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

                  \[\leadsto \frac{x \cdot y}{z} \]
                2. lower-*.f6440.8

                  \[\leadsto \frac{x \cdot y}{z} \]
              8. Applied rewrites40.8%

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

            Alternative 12: 69.0% accurate, 0.8× speedup?

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

              1. Initial program 80.5%

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

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

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

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

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

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

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

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

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

              if -9.00000000000000017e-90 < a < 5.79999999999999971e80

              1. Initial program 72.1%

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(t - x\right) \cdot \frac{y - z}{z}, -1, x\right) \]
                8. lift--.f6464.3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 5.79999999999999971e80 < a

              1. Initial program 95.8%

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

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

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

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

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

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

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

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

            Alternative 13: 59.0% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.7 \cdot 10^{-12} \lor \neg \left(a \leq 400000\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \left(\frac{y}{z} - 1\right)\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (if (or (<= a -5.7e-12) (not (<= a 400000.0)))
               (fma y (/ (- t x) a) x)
               (* (- t) (- (/ y z) 1.0))))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if ((a <= -5.7e-12) || !(a <= 400000.0)) {
            		tmp = fma(y, ((t - x) / a), x);
            	} else {
            		tmp = -t * ((y / z) - 1.0);
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if ((a <= -5.7e-12) || !(a <= 400000.0))
            		tmp = fma(y, Float64(Float64(t - x) / a), x);
            	else
            		tmp = Float64(Float64(-t) * Float64(Float64(y / z) - 1.0));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.7e-12], N[Not[LessEqual[a, 400000.0]], $MachinePrecision]], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[((-t) * N[(N[(y / z), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq -5.7 \cdot 10^{-12} \lor \neg \left(a \leq 400000\right):\\
            \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(-t\right) \cdot \left(\frac{y}{z} - 1\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -5.7000000000000003e-12 or 4e5 < a

              1. Initial program 86.2%

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

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

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

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

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

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

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

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

              if -5.7000000000000003e-12 < a < 4e5

              1. Initial program 71.9%

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(t - x\right) \cdot \frac{y - z}{z}, -1, x\right) \]
                8. lift--.f6463.0

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

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

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

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

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

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

                  \[\leadsto -t \cdot \left(\frac{y}{z} - 1\right) \]
                5. lower-/.f6455.7

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

                \[\leadsto -t \cdot \left(\frac{y}{z} - 1\right) \]
            3. Recombined 2 regimes into one program.
            4. Final simplification60.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.7 \cdot 10^{-12} \lor \neg \left(a \leq 400000\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-t\right) \cdot \left(\frac{y}{z} - 1\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 14: 56.0% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-93} \lor \neg \left(a \leq 5.5 \cdot 10^{-89}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (if (or (<= a -5.2e-93) (not (<= a 5.5e-89)))
               (fma y (/ (- t x) a) x)
               (* y (/ (- x t) z))))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if ((a <= -5.2e-93) || !(a <= 5.5e-89)) {
            		tmp = fma(y, ((t - x) / a), x);
            	} else {
            		tmp = y * ((x - t) / z);
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if ((a <= -5.2e-93) || !(a <= 5.5e-89))
            		tmp = fma(y, Float64(Float64(t - x) / a), x);
            	else
            		tmp = Float64(y * Float64(Float64(x - t) / z));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.2e-93], N[Not[LessEqual[a, 5.5e-89]], $MachinePrecision]], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq -5.2 \cdot 10^{-93} \lor \neg \left(a \leq 5.5 \cdot 10^{-89}\right):\\
            \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;y \cdot \frac{x - t}{z}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -5.1999999999999997e-93 or 5.50000000000000012e-89 < a

              1. Initial program 84.0%

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

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

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

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

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

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

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

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

              if -5.1999999999999997e-93 < a < 5.50000000000000012e-89

              1. Initial program 70.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)} \]
              5. 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}} \]
              6. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto y \cdot \frac{x - t}{z} \]
                4. lower--.f6452.9

                  \[\leadsto y \cdot \frac{x - t}{z} \]
              10. Applied rewrites52.9%

                \[\leadsto y \cdot \color{blue}{\frac{x - t}{z}} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification57.5%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{-93} \lor \neg \left(a \leq 5.5 \cdot 10^{-89}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - x}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 15: 50.2% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{-91} \lor \neg \left(a \leq 2300000\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (if (or (<= a -4.6e-91) (not (<= a 2300000.0)))
               (fma y (/ t a) x)
               (* y (/ (- x t) z))))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if ((a <= -4.6e-91) || !(a <= 2300000.0)) {
            		tmp = fma(y, (t / a), x);
            	} else {
            		tmp = y * ((x - t) / z);
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if ((a <= -4.6e-91) || !(a <= 2300000.0))
            		tmp = fma(y, Float64(t / a), x);
            	else
            		tmp = Float64(y * Float64(Float64(x - t) / z));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.6e-91], N[Not[LessEqual[a, 2300000.0]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq -4.6 \cdot 10^{-91} \lor \neg \left(a \leq 2300000\right):\\
            \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;y \cdot \frac{x - t}{z}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -4.59999999999999991e-91 or 2.3e6 < a

              1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

                if -4.59999999999999991e-91 < a < 2.3e6

                1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)} \]
                5. 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}} \]
                6. 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. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto y \cdot \frac{x - t}{z} \]
                  4. lower--.f6449.0

                    \[\leadsto y \cdot \frac{x - t}{z} \]
                10. Applied rewrites49.0%

                  \[\leadsto y \cdot \color{blue}{\frac{x - t}{z}} \]
              8. Recombined 2 regimes into one program.
              9. Final simplification54.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{-91} \lor \neg \left(a \leq 2300000\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 16: 37.6% accurate, 2.2× speedup?

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

                1. Initial program 88.5%

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

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Applied rewrites49.2%

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

                  if -1.15e6 < a < 4.20000000000000015e70

                  1. Initial program 72.3%

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

                    \[\leadsto \color{blue}{t} \]
                  4. Step-by-step derivation
                    1. Applied rewrites35.7%

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

                  Alternative 17: 24.2% accurate, 29.0× speedup?

                  \[\begin{array}{l} \\ t \end{array} \]
                  (FPCore (x y z t a) :precision binary64 t)
                  double code(double x, double y, double z, double t, double a) {
                  	return t;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z, t, a)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8), intent (in) :: a
                      code = t
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a) {
                  	return t;
                  }
                  
                  def code(x, y, z, t, a):
                  	return t
                  
                  function code(x, y, z, t, a)
                  	return t
                  end
                  
                  function tmp = code(x, y, z, t, a)
                  	tmp = t;
                  end
                  
                  code[x_, y_, z_, t_, a_] := t
                  
                  \begin{array}{l}
                  
                  \\
                  t
                  \end{array}
                  
                  Derivation
                  1. Initial program 79.2%

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

                    \[\leadsto \color{blue}{t} \]
                  4. Step-by-step derivation
                    1. Applied rewrites23.6%

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

                    Reproduce

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