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

Percentage Accurate: 67.4% → 90.6%
Time: 4.5s
Alternatives: 14
Speedup: 0.8×

Specification

?
\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a):
	return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - x) * (z - t)) / (a - t));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 67.4% accurate, 1.0× speedup?

\[x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a):
	return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (((y - x) * (z - t)) / (a - t));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}

Alternative 1: 90.6% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.2% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 70.1% accurate, 0.7× speedup?

\[\begin{array}{l} t_1 := z \cdot \left(y - x\right)\\ t_2 := y + -1 \cdot \frac{t\_1}{t}\\ \mathbf{if}\;t \leq -54000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{+24}:\\ \;\;\;\;x + \frac{t\_1}{a - t}\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+176}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\frac{z - t}{a - t} \cdot y\\ \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* z (- y x))) (t_2 (+ y (* -1.0 (/ t_1 t)))))
   (if (<= t -54000000.0)
     t_2
     (if (<= t 5.6e+24)
       (+ x (/ t_1 (- a t)))
       (if (<= t 8.5e+176) t_2 (* (/ (- z t) (- a t)) y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (y - x);
	double t_2 = y + (-1.0 * (t_1 / t));
	double tmp;
	if (t <= -54000000.0) {
		tmp = t_2;
	} else if (t <= 5.6e+24) {
		tmp = x + (t_1 / (a - t));
	} else if (t <= 8.5e+176) {
		tmp = t_2;
	} else {
		tmp = ((z - t) / (a - t)) * y;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * (y - x)
    t_2 = y + ((-1.0d0) * (t_1 / t))
    if (t <= (-54000000.0d0)) then
        tmp = t_2
    else if (t <= 5.6d+24) then
        tmp = x + (t_1 / (a - t))
    else if (t <= 8.5d+176) then
        tmp = t_2
    else
        tmp = ((z - t) / (a - t)) * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (y - x);
	double t_2 = y + (-1.0 * (t_1 / t));
	double tmp;
	if (t <= -54000000.0) {
		tmp = t_2;
	} else if (t <= 5.6e+24) {
		tmp = x + (t_1 / (a - t));
	} else if (t <= 8.5e+176) {
		tmp = t_2;
	} else {
		tmp = ((z - t) / (a - t)) * y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = z * (y - x)
	t_2 = y + (-1.0 * (t_1 / t))
	tmp = 0
	if t <= -54000000.0:
		tmp = t_2
	elif t <= 5.6e+24:
		tmp = x + (t_1 / (a - t))
	elif t <= 8.5e+176:
		tmp = t_2
	else:
		tmp = ((z - t) / (a - t)) * y
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(z * Float64(y - x))
	t_2 = Float64(y + Float64(-1.0 * Float64(t_1 / t)))
	tmp = 0.0
	if (t <= -54000000.0)
		tmp = t_2;
	elseif (t <= 5.6e+24)
		tmp = Float64(x + Float64(t_1 / Float64(a - t)));
	elseif (t <= 8.5e+176)
		tmp = t_2;
	else
		tmp = Float64(Float64(Float64(z - t) / Float64(a - t)) * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = z * (y - x);
	t_2 = y + (-1.0 * (t_1 / t));
	tmp = 0.0;
	if (t <= -54000000.0)
		tmp = t_2;
	elseif (t <= 5.6e+24)
		tmp = x + (t_1 / (a - t));
	elseif (t <= 8.5e+176)
		tmp = t_2;
	else
		tmp = ((z - t) / (a - t)) * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(-1.0 * N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -54000000.0], t$95$2, If[LessEqual[t, 5.6e+24], N[(x + N[(t$95$1 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+176], t$95$2, N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := z \cdot \left(y - x\right)\\
t_2 := y + -1 \cdot \frac{t\_1}{t}\\
\mathbf{if}\;t \leq -54000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 5.6 \cdot 10^{+24}:\\
\;\;\;\;x + \frac{t\_1}{a - t}\\

\mathbf{elif}\;t \leq 8.5 \cdot 10^{+176}:\\
\;\;\;\;t\_2\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.4e7 or 5.6000000000000003e24 < t < 8.4999999999999995e176

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4e7 < t < 5.6000000000000003e24

    1. Initial program 67.4%

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

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

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

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

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

    if 8.4999999999999995e176 < t

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{t - z}{\color{blue}{t - a}} \]
      12. *-commutativeN/A

        \[\leadsto \frac{t - z}{t - a} \cdot \color{blue}{y} \]
      13. lower-*.f6451.5

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

        \[\leadsto \frac{t - z}{t - a} \cdot y \]
      15. frac-2negN/A

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{a - t} \cdot y \]
      22. lower-/.f6451.5

        \[\leadsto \frac{z - t}{a - t} \cdot y \]
    6. Applied rewrites51.5%

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

Alternative 4: 69.4% accurate, 0.8× speedup?

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

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

real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = ((z - t) / (a - t)) * y
    if (t <= (-3.4d+46)) then
        tmp = t_1
    else if (t <= 3.4d+46) then
        tmp = x + ((z * (y - x)) / (a - t))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = ((z - t) / (a - t)) * y;
	double tmp;
	if (t <= -3.4e+46) {
		tmp = t_1;
	} else if (t <= 3.4e+46) {
		tmp = x + ((z * (y - x)) / (a - t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = ((z - t) / (a - t)) * y
	tmp = 0
	if t <= -3.4e+46:
		tmp = t_1
	elif t <= 3.4e+46:
		tmp = x + ((z * (y - x)) / (a - t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(Float64(z - t) / Float64(a - t)) * y)
	tmp = 0.0
	if (t <= -3.4e+46)
		tmp = t_1;
	elseif (t <= 3.4e+46)
		tmp = Float64(x + Float64(Float64(z * Float64(y - x)) / Float64(a - t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = ((z - t) / (a - t)) * y;
	tmp = 0.0;
	if (t <= -3.4e+46)
		tmp = t_1;
	elseif (t <= 3.4e+46)
		tmp = x + ((z * (y - x)) / (a - t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t, -3.4e+46], t$95$1, If[LessEqual[t, 3.4e+46], N[(x + N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z - t}{a - t} \cdot y\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.3999999999999998e46 or 3.3999999999999998e46 < t

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{t - z}{\color{blue}{t - a}} \]
      12. *-commutativeN/A

        \[\leadsto \frac{t - z}{t - a} \cdot \color{blue}{y} \]
      13. lower-*.f6451.5

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

        \[\leadsto \frac{t - z}{t - a} \cdot y \]
      15. frac-2negN/A

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{a - t} \cdot y \]
      22. lower-/.f6451.5

        \[\leadsto \frac{z - t}{a - t} \cdot y \]
    6. Applied rewrites51.5%

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

    if -3.3999999999999998e46 < t < 3.3999999999999998e46

    1. Initial program 67.4%

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

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

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

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

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

Alternative 5: 66.3% accurate, 0.9× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.6e8 or 1.72000000000000011e34 < t

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{t - z}{\color{blue}{t - a}} \]
      12. *-commutativeN/A

        \[\leadsto \frac{t - z}{t - a} \cdot \color{blue}{y} \]
      13. lower-*.f6451.5

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

        \[\leadsto \frac{t - z}{t - a} \cdot y \]
      15. frac-2negN/A

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{a - t} \cdot y \]
      22. lower-/.f6451.5

        \[\leadsto \frac{z - t}{a - t} \cdot y \]
    6. Applied rewrites51.5%

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

    if -7.6e8 < t < 1.72000000000000011e34

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 62.8% accurate, 0.9× speedup?

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

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.99999999999999988e166 or 4.2e17 < z

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x - y}{t - a} \cdot z \]
      14. lower--.f6442.3

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

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

    if -1.99999999999999988e166 < z < 4.2e17

    1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 62.0% accurate, 0.9× speedup?

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

        1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -7.6e8 < t < 1.72000000000000011e34

        1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 8: 61.1% accurate, 0.9× speedup?

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

        1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -3.20000000000000029e57 < t < 1.5e36

            1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 9: 55.6% accurate, 0.9× speedup?

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

            1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{1}, y - x, x\right) \]
            5. Step-by-step derivation
              1. Applied rewrites19.3%

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

              if -1.8999999999999999e107 < t < 3.19999999999999976e76

              1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 10: 36.6% accurate, 1.0× speedup?

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

              1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{1}, y - x, x\right) \]
              5. Step-by-step derivation
                1. Applied rewrites19.3%

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

                if -4.3999999999999999e59 < t < 3.7e52

                1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto z \cdot \frac{y - x}{a} \]
                  2. lower--.f6425.9

                    \[\leadsto z \cdot \frac{y - x}{a} \]
                7. Applied rewrites25.9%

                  \[\leadsto z \cdot \frac{y - x}{\color{blue}{a}} \]
              6. Recombined 2 regimes into one program.
              7. Add Preprocessing

              Alternative 11: 32.0% accurate, 1.0× speedup?

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

                1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{1}, y - x, x\right) \]
                5. Step-by-step derivation
                  1. Applied rewrites19.3%

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

                  if -6.80000000000000027e119 < t < 2.09999999999999995e42

                  1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto z \cdot \frac{y}{a - \color{blue}{t}} \]
                    2. lower--.f6422.9

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

                    \[\leadsto z \cdot \frac{y}{\color{blue}{a - t}} \]
                6. Recombined 2 regimes into one program.
                7. Add Preprocessing

                Alternative 12: 30.3% accurate, 1.1× speedup?

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

                  1. Initial program 67.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{1}, y - x, x\right) \]
                  5. Step-by-step derivation
                    1. Applied rewrites19.3%

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

                    if -4.3999999999999999e59 < t < 9.60000000000000034e46

                    1. Initial program 67.4%

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{y \cdot z}{a} \]
                      2. lower-*.f6416.4

                        \[\leadsto \frac{y \cdot z}{a} \]
                    7. Applied rewrites16.4%

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

                        \[\leadsto \frac{y \cdot z}{a} \]
                      2. lift-*.f64N/A

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

                        \[\leadsto y \cdot \frac{z}{\color{blue}{a}} \]
                      4. *-commutativeN/A

                        \[\leadsto \frac{z}{a} \cdot y \]
                      5. lower-*.f64N/A

                        \[\leadsto \frac{z}{a} \cdot y \]
                      6. lower-/.f6419.1

                        \[\leadsto \frac{z}{a} \cdot y \]
                    9. Applied rewrites19.1%

                      \[\leadsto \frac{z}{a} \cdot y \]
                  6. Recombined 2 regimes into one program.
                  7. Add Preprocessing

                  Alternative 13: 19.1% accurate, 2.4× speedup?

                  \[\frac{z}{a} \cdot y \]
                  (FPCore (x y z t a) :precision binary64 (* (/ z a) y))
                  double code(double x, double y, double z, double t, double a) {
                  	return (z / a) * y;
                  }
                  
                  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 = (z / a) * y
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a) {
                  	return (z / a) * y;
                  }
                  
                  def code(x, y, z, t, a):
                  	return (z / a) * y
                  
                  function code(x, y, z, t, a)
                  	return Float64(Float64(z / a) * y)
                  end
                  
                  function tmp = code(x, y, z, t, a)
                  	tmp = (z / a) * y;
                  end
                  
                  code[x_, y_, z_, t_, a_] := N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]
                  
                  \frac{z}{a} \cdot y
                  
                  Derivation
                  1. Initial program 67.4%

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{y \cdot z}{a} \]
                    2. lower-*.f6416.4

                      \[\leadsto \frac{y \cdot z}{a} \]
                  7. Applied rewrites16.4%

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

                      \[\leadsto \frac{y \cdot z}{a} \]
                    2. lift-*.f64N/A

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

                      \[\leadsto y \cdot \frac{z}{\color{blue}{a}} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{z}{a} \cdot y \]
                    5. lower-*.f64N/A

                      \[\leadsto \frac{z}{a} \cdot y \]
                    6. lower-/.f6419.1

                      \[\leadsto \frac{z}{a} \cdot y \]
                  9. Applied rewrites19.1%

                    \[\leadsto \frac{z}{a} \cdot y \]
                  10. Add Preprocessing

                  Alternative 14: 17.8% accurate, 2.4× speedup?

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{y \cdot z}{a} \]
                    2. lower-*.f6416.4

                      \[\leadsto \frac{y \cdot z}{a} \]
                  7. Applied rewrites16.4%

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

                      \[\leadsto \frac{y \cdot z}{a} \]
                    2. mult-flipN/A

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

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

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

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

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

                      \[\leadsto z \cdot \frac{y}{a} \]
                    8. lower-/.f6417.8

                      \[\leadsto z \cdot \frac{y}{a} \]
                  9. Applied rewrites17.8%

                    \[\leadsto z \cdot \frac{y}{\color{blue}{a}} \]
                  10. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2025172 
                  (FPCore (x y z t a)
                    :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
                    :precision binary64
                    (+ x (/ (* (- y x) (- z t)) (- a t))))