Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3

Percentage Accurate: 68.1% → 86.6%
Time: 8.8s
Alternatives: 13
Speedup: 0.8×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 86.6% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.6999999999999999e177

    1. Initial program 21.2%

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

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

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

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

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

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

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

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

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

      \[\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}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    6. Step-by-step derivation
      1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e177 < z < 6.1999999999999996e160

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

    if 6.1999999999999996e160 < z

    1. Initial program 30.9%

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

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

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

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

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

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

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

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

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

      \[\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(\color{blue}{\frac{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. flip--N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - x}{a \cdot a - z \cdot z}} \cdot \left(a + z\right), y - z, x\right) \]
      7. difference-of-squaresN/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 86.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+177} \lor \neg \left(z \leq 6.2 \cdot 10^{+160}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, y, a\right), \frac{t - x}{z}, t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6999999999999999e177 or 6.1999999999999996e160 < z

    1. Initial program 25.5%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{t - x}{a - z}}, y - z, x\right) \]
    4. Applied rewrites49.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}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    6. Step-by-step derivation
      1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

    if -1.6999999999999999e177 < z < 6.1999999999999996e160

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 74.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-51} \lor \neg \left(z \leq 6.4 \cdot 10^{+17}\right):\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, y, a\right), \frac{t - x}{z}, t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.4999999999999997e-51 or 6.4e17 < z

    1. Initial program 45.3%

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

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

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

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

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

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

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

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

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

      \[\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}{\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    6. Step-by-step derivation
      1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999997e-51 < z < 6.4e17

    1. Initial program 91.8%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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. *-commutativeN/A

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

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

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

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

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

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

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

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

Alternative 4: 70.5% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.6e-51 or 1.2499999999999999e196 < z

    1. Initial program 40.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.6e-51 < z < 8e17

      1. Initial program 91.8%

        \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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. *-commutativeN/A

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

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

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

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

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

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

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

      if 8e17 < z < 1.2499999999999999e196

      1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
        6. div-subN/A

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

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

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

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

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

    Alternative 5: 69.0% accurate, 0.7× speedup?

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

      1. Initial program 40.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -3.6e-51 < z < 2.3e16

        1. Initial program 91.8%

          \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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. *-commutativeN/A

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

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

            \[\leadsto \mathsf{fma}\left(\frac{t - x}{a}, y, x\right) \]
          6. lower--.f6478.1

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

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

        if 2.3e16 < z < 1.2499999999999999e196

        1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
          6. div-subN/A

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

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

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

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

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

      Alternative 6: 63.2% accurate, 0.7× speedup?

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

        1. Initial program 40.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -3.00000000000000002e-51 < z < 2.3e16

          1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
          6. 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. lower--.f6478.1

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

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

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

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

            if 2.3e16 < z < 1.2499999999999999e196

            1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
              6. div-subN/A

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-51}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+196}:\\ \;\;\;\;\mathsf{fma}\left(\frac{x - t}{z}, y, t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \frac{y - a}{z}, t\right)\\ \end{array} \]
          12. Add Preprocessing

          Alternative 7: 74.7% accurate, 0.8× speedup?

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

            1. Initial program 45.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -3.4999999999999997e-51 < z < 6.4e17

            1. Initial program 91.8%

              \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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. *-commutativeN/A

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

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

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

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

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

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

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

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

          Alternative 8: 52.7% accurate, 0.8× speedup?

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

            1. Initial program 35.5%

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

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

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

              if -1.5e103 < z < 2.55e16

              1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
              6. 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. lower--.f6471.8

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

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

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

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

                if 2.55e16 < z < 1.13999999999999993e92

                1. Initial program 60.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+103}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.55 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t}{a}, x\right)\\ \mathbf{elif}\;z \leq 1.14 \cdot 10^{+92}:\\ \;\;\;\;\frac{x - t}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
              12. Add Preprocessing

              Alternative 9: 63.3% accurate, 0.9× speedup?

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

                1. Initial program 45.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{x}{z} - \frac{t}{z}, y, t\right) \]
                  6. div-subN/A

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

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

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

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

                if -2.8e-51 < z < 2.3e16

                1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                6. 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. lower--.f6478.1

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

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

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

                    \[\leadsto \mathsf{fma}\left(y, \frac{t}{a}, x\right) \]
                10. Recombined 2 regimes into one program.
                11. Final simplification64.5%

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

                Alternative 10: 52.6% accurate, 1.0× speedup?

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

                  1. Initial program 34.9%

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

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

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

                    if -1.5e103 < z < 4.49999999999999972e94

                    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{x + \frac{y \cdot \left(t - x\right)}{a}} \]
                    6. 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. lower--.f6465.3

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

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

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

                        \[\leadsto \mathsf{fma}\left(y, \frac{t}{a}, x\right) \]
                    10. Recombined 2 regimes into one program.
                    11. Final simplification50.9%

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

                    Alternative 11: 39.2% accurate, 1.5× speedup?

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

                      1. Initial program 38.2%

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

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

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

                        if -6.5e180 < z < -4.59999999999999975e-179

                        1. Initial program 74.6%

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

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

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

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

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

                            \[\leadsto x + t \]

                          if -4.59999999999999975e-179 < z < 9.60000000000000018e26

                          1. Initial program 90.8%

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

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

                              \[\leadsto \color{blue}{x} \]
                          5. Recombined 3 regimes into one program.
                          6. Final simplification41.2%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+180}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-179}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{+26}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                          7. Add Preprocessing

                          Alternative 12: 38.7% accurate, 2.2× speedup?

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

                            1. Initial program 41.8%

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

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

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

                              if -4.5e5 < z < 9.60000000000000018e26

                              1. Initial program 90.4%

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

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

                                  \[\leadsto \color{blue}{x} \]
                              5. Recombined 2 regimes into one program.
                              6. Final simplification39.1%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -450000:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 9.6 \cdot 10^{+26}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 13: 24.9% 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 64.9%

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

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

                                  \[\leadsto \color{blue}{t} \]
                                2. Final simplification26.9%

                                  \[\leadsto t \]
                                3. Add Preprocessing

                                Developer Target 1: 83.7% accurate, 0.6× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                (FPCore (x y z t a)
                                 :precision binary64
                                 (let* ((t_1 (- t (* (/ y z) (- t x)))))
                                   (if (< z -1.2536131056095036e+188)
                                     t_1
                                     (if (< z 4.446702369113811e+64)
                                       (+ x (/ (- y z) (/ (- a z) (- t x))))
                                       t_1))))
                                double code(double x, double y, double z, double t, double a) {
                                	double t_1 = t - ((y / z) * (t - x));
                                	double tmp;
                                	if (z < -1.2536131056095036e+188) {
                                		tmp = t_1;
                                	} else if (z < 4.446702369113811e+64) {
                                		tmp = x + ((y - z) / ((a - z) / (t - x)));
                                	} else {
                                		tmp = t_1;
                                	}
                                	return tmp;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y, z, t, a)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    real(8), intent (in) :: a
                                    real(8) :: t_1
                                    real(8) :: tmp
                                    t_1 = t - ((y / z) * (t - x))
                                    if (z < (-1.2536131056095036d+188)) then
                                        tmp = t_1
                                    else if (z < 4.446702369113811d+64) then
                                        tmp = x + ((y - z) / ((a - z) / (t - x)))
                                    else
                                        tmp = t_1
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double y, double z, double t, double a) {
                                	double t_1 = t - ((y / z) * (t - x));
                                	double tmp;
                                	if (z < -1.2536131056095036e+188) {
                                		tmp = t_1;
                                	} else if (z < 4.446702369113811e+64) {
                                		tmp = x + ((y - z) / ((a - z) / (t - x)));
                                	} else {
                                		tmp = t_1;
                                	}
                                	return tmp;
                                }
                                
                                def code(x, y, z, t, a):
                                	t_1 = t - ((y / z) * (t - x))
                                	tmp = 0
                                	if z < -1.2536131056095036e+188:
                                		tmp = t_1
                                	elif z < 4.446702369113811e+64:
                                		tmp = x + ((y - z) / ((a - z) / (t - x)))
                                	else:
                                		tmp = t_1
                                	return tmp
                                
                                function code(x, y, z, t, a)
                                	t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x)))
                                	tmp = 0.0
                                	if (z < -1.2536131056095036e+188)
                                		tmp = t_1;
                                	elseif (z < 4.446702369113811e+64)
                                		tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x))));
                                	else
                                		tmp = t_1;
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, y, z, t, a)
                                	t_1 = t - ((y / z) * (t - x));
                                	tmp = 0.0;
                                	if (z < -1.2536131056095036e+188)
                                		tmp = t_1;
                                	elseif (z < 4.446702369113811e+64)
                                		tmp = x + ((y - z) / ((a - z) / (t - x)));
                                	else
                                		tmp = t_1;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
                                \mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
                                \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_1\\
                                
                                
                                \end{array}
                                \end{array}
                                

                                Reproduce

                                ?
                                herbie shell --seed 2025026 
                                (FPCore (x y z t a)
                                  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
                                  :precision binary64
                                
                                  :alt
                                  (! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))
                                
                                  (+ x (/ (* (- y z) (- t x)) (- a z))))