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

Percentage Accurate: 67.0% → 88.9%
Time: 5.2s
Alternatives: 18
Speedup: 0.7×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \end{array} \]
(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]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 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.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \end{array} \]
(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]
\begin{array}{l}

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

Alternative 1: 88.9% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 70.8%

      \[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. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 27.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t \cdot y - \left(y - x\right) \cdot \left(z - a\right)}{t} \]
      6. lift-*.f6479.3

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

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

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

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.9% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 70.8%

      \[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. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 27.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{t - z}{t - a}, 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^{-154}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 71.3%

      \[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. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 27.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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 69.9% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.12000000000000006e-129 or 3.3999999999999999e34 < a

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

    if -1.12000000000000006e-129 < a < -1.70000000000000008e-217

    1. Initial program 63.1%

      \[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. sub-divN/A

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

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

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

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

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

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

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

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

    if -1.70000000000000008e-217 < a < 3.3999999999999999e34

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.7% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.12000000000000006e-129 or 3.3999999999999999e34 < a

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

    if -1.12000000000000006e-129 < a < -1.70000000000000008e-217

    1. Initial program 63.1%

      \[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. sub-divN/A

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

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

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

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

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

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

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

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

    if -1.70000000000000008e-217 < a < 3.3999999999999999e34

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 66.1% accurate, 0.9× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.35e-40

    1. Initial program 48.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-40 < t < 5.1999999999999997e-109

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.1999999999999997e-109 < t

    1. Initial program 56.4%

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

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

        \[\leadsto \color{blue}{x} \]
      2. Taylor expanded in y around inf

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

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

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

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

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

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

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

    Alternative 7: 65.8% accurate, 0.9× speedup?

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

      1. Initial program 48.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.35e-40 < t < 5.1999999999999997e-109

      1. Initial program 89.9%

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

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

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

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

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

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

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

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

      if 5.1999999999999997e-109 < t

      1. Initial program 56.4%

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

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

          \[\leadsto \color{blue}{x} \]
        2. Taylor expanded in y around inf

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

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

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

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

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

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

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

      Alternative 8: 64.8% accurate, 0.9× speedup?

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

        1. Initial program 48.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -8.40000000000000051e-41 < t < 5.1999999999999997e-109

        1. Initial program 89.9%

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

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

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

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

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

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

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

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

        if 5.1999999999999997e-109 < t

        1. Initial program 56.4%

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

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

            \[\leadsto \color{blue}{x} \]
          2. Taylor expanded in y around inf

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

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

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

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

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

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

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

        Alternative 9: 64.7% accurate, 0.9× speedup?

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

          1. Initial program 68.1%

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

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

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

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

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

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

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

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

          if -1.28000000000000002e-123 < a < 5.99999999999999987e-16

          1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 10: 59.6% accurate, 0.9× speedup?

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

          1. Initial program 29.6%

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

            \[\leadsto \color{blue}{y} \]
          3. Step-by-step derivation
            1. Applied rewrites54.8%

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

            if -2.50000000000000015e139 < t < 8.59999999999999964e132

            1. Initial program 81.2%

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

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

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

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

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

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

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

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

          Alternative 11: 40.6% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(y - x\right) \cdot z}{a}\\ \mathbf{if}\;z \leq -2.8 \cdot 10^{+224}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{+155}:\\ \;\;\;\;z \cdot \frac{x - y}{t}\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-148}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-215}:\\ \;\;\;\;-t \cdot \frac{y}{a - t}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t a)
           :precision binary64
           (let* ((t_1 (/ (* (- y x) z) a)))
             (if (<= z -2.8e+224)
               (* y (/ (- z t) a))
               (if (<= z -3.5e+155)
                 (* z (/ (- x y) t))
                 (if (<= z -2.1e+93)
                   t_1
                   (if (<= z -1.15e-148)
                     x
                     (if (<= z 6e-215)
                       (- (* t (/ y (- a t))))
                       (if (<= z 1.7e-17) x t_1))))))))
          double code(double x, double y, double z, double t, double a) {
          	double t_1 = ((y - x) * z) / a;
          	double tmp;
          	if (z <= -2.8e+224) {
          		tmp = y * ((z - t) / a);
          	} else if (z <= -3.5e+155) {
          		tmp = z * ((x - y) / t);
          	} else if (z <= -2.1e+93) {
          		tmp = t_1;
          	} else if (z <= -1.15e-148) {
          		tmp = x;
          	} else if (z <= 6e-215) {
          		tmp = -(t * (y / (a - t)));
          	} else if (z <= 1.7e-17) {
          		tmp = x;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t, a)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8), intent (in) :: a
              real(8) :: t_1
              real(8) :: tmp
              t_1 = ((y - x) * z) / a
              if (z <= (-2.8d+224)) then
                  tmp = y * ((z - t) / a)
              else if (z <= (-3.5d+155)) then
                  tmp = z * ((x - y) / t)
              else if (z <= (-2.1d+93)) then
                  tmp = t_1
              else if (z <= (-1.15d-148)) then
                  tmp = x
              else if (z <= 6d-215) then
                  tmp = -(t * (y / (a - t)))
              else if (z <= 1.7d-17) then
                  tmp = x
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t, double a) {
          	double t_1 = ((y - x) * z) / a;
          	double tmp;
          	if (z <= -2.8e+224) {
          		tmp = y * ((z - t) / a);
          	} else if (z <= -3.5e+155) {
          		tmp = z * ((x - y) / t);
          	} else if (z <= -2.1e+93) {
          		tmp = t_1;
          	} else if (z <= -1.15e-148) {
          		tmp = x;
          	} else if (z <= 6e-215) {
          		tmp = -(t * (y / (a - t)));
          	} else if (z <= 1.7e-17) {
          		tmp = x;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t, a):
          	t_1 = ((y - x) * z) / a
          	tmp = 0
          	if z <= -2.8e+224:
          		tmp = y * ((z - t) / a)
          	elif z <= -3.5e+155:
          		tmp = z * ((x - y) / t)
          	elif z <= -2.1e+93:
          		tmp = t_1
          	elif z <= -1.15e-148:
          		tmp = x
          	elif z <= 6e-215:
          		tmp = -(t * (y / (a - t)))
          	elif z <= 1.7e-17:
          		tmp = x
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t, a)
          	t_1 = Float64(Float64(Float64(y - x) * z) / a)
          	tmp = 0.0
          	if (z <= -2.8e+224)
          		tmp = Float64(y * Float64(Float64(z - t) / a));
          	elseif (z <= -3.5e+155)
          		tmp = Float64(z * Float64(Float64(x - y) / t));
          	elseif (z <= -2.1e+93)
          		tmp = t_1;
          	elseif (z <= -1.15e-148)
          		tmp = x;
          	elseif (z <= 6e-215)
          		tmp = Float64(-Float64(t * Float64(y / Float64(a - t))));
          	elseif (z <= 1.7e-17)
          		tmp = x;
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t, a)
          	t_1 = ((y - x) * z) / a;
          	tmp = 0.0;
          	if (z <= -2.8e+224)
          		tmp = y * ((z - t) / a);
          	elseif (z <= -3.5e+155)
          		tmp = z * ((x - y) / t);
          	elseif (z <= -2.1e+93)
          		tmp = t_1;
          	elseif (z <= -1.15e-148)
          		tmp = x;
          	elseif (z <= 6e-215)
          		tmp = -(t * (y / (a - t)));
          	elseif (z <= 1.7e-17)
          		tmp = x;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -2.8e+224], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e+155], N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e+93], t$95$1, If[LessEqual[z, -1.15e-148], x, If[LessEqual[z, 6e-215], (-N[(t * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[z, 1.7e-17], x, t$95$1]]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \frac{\left(y - x\right) \cdot z}{a}\\
          \mathbf{if}\;z \leq -2.8 \cdot 10^{+224}:\\
          \;\;\;\;y \cdot \frac{z - t}{a}\\
          
          \mathbf{elif}\;z \leq -3.5 \cdot 10^{+155}:\\
          \;\;\;\;z \cdot \frac{x - y}{t}\\
          
          \mathbf{elif}\;z \leq -2.1 \cdot 10^{+93}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;z \leq -1.15 \cdot 10^{-148}:\\
          \;\;\;\;x\\
          
          \mathbf{elif}\;z \leq 6 \cdot 10^{-215}:\\
          \;\;\;\;-t \cdot \frac{y}{a - t}\\
          
          \mathbf{elif}\;z \leq 1.7 \cdot 10^{-17}:\\
          \;\;\;\;x\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 5 regimes
          2. if z < -2.80000000000000008e224

            1. Initial program 70.1%

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

              \[\leadsto \color{blue}{x} \]
            3. Step-by-step derivation
              1. Applied rewrites5.8%

                \[\leadsto \color{blue}{x} \]
              2. Taylor expanded in y around inf

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

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

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

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

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

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

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

                \[\leadsto y \cdot \frac{z - t}{a} \]
              6. Step-by-step derivation
                1. Applied rewrites40.1%

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

                if -2.80000000000000008e224 < z < -3.49999999999999985e155

                1. Initial program 65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto z \cdot \frac{x - y}{t} \]
                7. Applied rewrites47.2%

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

                if -3.49999999999999985e155 < z < -2.0999999999999998e93 or 1.6999999999999999e-17 < 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. sub-divN/A

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\left(y - x\right) \cdot z}{a} \]
                6. Step-by-step derivation
                  1. Applied rewrites34.4%

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

                  if -2.0999999999999998e93 < z < -1.14999999999999999e-148 or 6.00000000000000051e-215 < z < 1.6999999999999999e-17

                  1. Initial program 67.7%

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

                    \[\leadsto \color{blue}{x} \]
                  3. Step-by-step derivation
                    1. Applied rewrites30.5%

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

                    if -1.14999999999999999e-148 < z < 6.00000000000000051e-215

                    1. Initial program 64.6%

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

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

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

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

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

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

                      \[\leadsto \frac{z \cdot y}{a - t} \]
                    6. Step-by-step derivation
                      1. Applied rewrites6.4%

                        \[\leadsto \frac{z \cdot y}{a - t} \]
                      2. Taylor expanded in z around 0

                        \[\leadsto -1 \cdot \color{blue}{\frac{t \cdot y}{a - t}} \]
                      3. Step-by-step derivation
                        1. mul-1-negN/A

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

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

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

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

                          \[\leadsto -t \cdot \frac{y}{a - t} \]
                        6. lift--.f6441.0

                          \[\leadsto -t \cdot \frac{y}{a - t} \]
                      4. Applied rewrites41.0%

                        \[\leadsto -t \cdot \frac{y}{a - t} \]
                    7. Recombined 5 regimes into one program.
                    8. Add Preprocessing

                    Alternative 12: 38.5% accurate, 0.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(y - x\right) \cdot z}{a}\\ \mathbf{if}\;a \leq -4.5 \cdot 10^{+38}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{-217}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-16}:\\ \;\;\;\;y\\ \mathbf{elif}\;a \leq 1400000:\\ \;\;\;\;\frac{x \cdot \left(z - a\right)}{t}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{+168}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                    (FPCore (x y z t a)
                     :precision binary64
                     (let* ((t_1 (/ (* (- y x) z) a)))
                       (if (<= a -4.5e+38)
                         x
                         (if (<= a -1.7e-217)
                           t_1
                           (if (<= a 1.9e-16)
                             y
                             (if (<= a 1400000.0)
                               (/ (* x (- z a)) t)
                               (if (<= a 6.2e+168) t_1 x)))))))
                    double code(double x, double y, double z, double t, double a) {
                    	double t_1 = ((y - x) * z) / a;
                    	double tmp;
                    	if (a <= -4.5e+38) {
                    		tmp = x;
                    	} else if (a <= -1.7e-217) {
                    		tmp = t_1;
                    	} else if (a <= 1.9e-16) {
                    		tmp = y;
                    	} else if (a <= 1400000.0) {
                    		tmp = (x * (z - a)) / t;
                    	} else if (a <= 6.2e+168) {
                    		tmp = t_1;
                    	} else {
                    		tmp = x;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z, t, a)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8), intent (in) :: a
                        real(8) :: t_1
                        real(8) :: tmp
                        t_1 = ((y - x) * z) / a
                        if (a <= (-4.5d+38)) then
                            tmp = x
                        else if (a <= (-1.7d-217)) then
                            tmp = t_1
                        else if (a <= 1.9d-16) then
                            tmp = y
                        else if (a <= 1400000.0d0) then
                            tmp = (x * (z - a)) / t
                        else if (a <= 6.2d+168) then
                            tmp = t_1
                        else
                            tmp = x
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a) {
                    	double t_1 = ((y - x) * z) / a;
                    	double tmp;
                    	if (a <= -4.5e+38) {
                    		tmp = x;
                    	} else if (a <= -1.7e-217) {
                    		tmp = t_1;
                    	} else if (a <= 1.9e-16) {
                    		tmp = y;
                    	} else if (a <= 1400000.0) {
                    		tmp = (x * (z - a)) / t;
                    	} else if (a <= 6.2e+168) {
                    		tmp = t_1;
                    	} else {
                    		tmp = x;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t, a):
                    	t_1 = ((y - x) * z) / a
                    	tmp = 0
                    	if a <= -4.5e+38:
                    		tmp = x
                    	elif a <= -1.7e-217:
                    		tmp = t_1
                    	elif a <= 1.9e-16:
                    		tmp = y
                    	elif a <= 1400000.0:
                    		tmp = (x * (z - a)) / t
                    	elif a <= 6.2e+168:
                    		tmp = t_1
                    	else:
                    		tmp = x
                    	return tmp
                    
                    function code(x, y, z, t, a)
                    	t_1 = Float64(Float64(Float64(y - x) * z) / a)
                    	tmp = 0.0
                    	if (a <= -4.5e+38)
                    		tmp = x;
                    	elseif (a <= -1.7e-217)
                    		tmp = t_1;
                    	elseif (a <= 1.9e-16)
                    		tmp = y;
                    	elseif (a <= 1400000.0)
                    		tmp = Float64(Float64(x * Float64(z - a)) / t);
                    	elseif (a <= 6.2e+168)
                    		tmp = t_1;
                    	else
                    		tmp = x;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t, a)
                    	t_1 = ((y - x) * z) / a;
                    	tmp = 0.0;
                    	if (a <= -4.5e+38)
                    		tmp = x;
                    	elseif (a <= -1.7e-217)
                    		tmp = t_1;
                    	elseif (a <= 1.9e-16)
                    		tmp = y;
                    	elseif (a <= 1400000.0)
                    		tmp = (x * (z - a)) / t;
                    	elseif (a <= 6.2e+168)
                    		tmp = t_1;
                    	else
                    		tmp = x;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -4.5e+38], x, If[LessEqual[a, -1.7e-217], t$95$1, If[LessEqual[a, 1.9e-16], y, If[LessEqual[a, 1400000.0], N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 6.2e+168], t$95$1, x]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \frac{\left(y - x\right) \cdot z}{a}\\
                    \mathbf{if}\;a \leq -4.5 \cdot 10^{+38}:\\
                    \;\;\;\;x\\
                    
                    \mathbf{elif}\;a \leq -1.7 \cdot 10^{-217}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;a \leq 1.9 \cdot 10^{-16}:\\
                    \;\;\;\;y\\
                    
                    \mathbf{elif}\;a \leq 1400000:\\
                    \;\;\;\;\frac{x \cdot \left(z - a\right)}{t}\\
                    
                    \mathbf{elif}\;a \leq 6.2 \cdot 10^{+168}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;x\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if a < -4.4999999999999998e38 or 6.19999999999999993e168 < a

                      1. Initial program 67.3%

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

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

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

                        if -4.4999999999999998e38 < a < -1.70000000000000008e-217 or 1.4e6 < a < 6.19999999999999993e168

                        1. Initial program 67.6%

                          \[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. sub-divN/A

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{\left(y - x\right) \cdot z}{a} \]
                        6. Step-by-step derivation
                          1. Applied rewrites27.7%

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

                          if -1.70000000000000008e-217 < a < 1.90000000000000006e-16

                          1. Initial program 65.7%

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

                            \[\leadsto \color{blue}{y} \]
                          3. Step-by-step derivation
                            1. Applied rewrites36.3%

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

                            if 1.90000000000000006e-16 < a < 1.4e6

                            1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{x \cdot \left(z - a\right)}{t} \]
                              3. lift--.f6424.2

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

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

                          Alternative 13: 37.5% accurate, 0.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{a - t}\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-222}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-82}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 1.92 \cdot 10^{+28}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                          (FPCore (x y z t a)
                           :precision binary64
                           (let* ((t_1 (* z (/ y (- a t)))))
                             (if (<= z -1.3e+93)
                               t_1
                               (if (<= z -8e-222) x (if (<= z 1.25e-82) y (if (<= z 1.92e+28) x t_1))))))
                          double code(double x, double y, double z, double t, double a) {
                          	double t_1 = z * (y / (a - t));
                          	double tmp;
                          	if (z <= -1.3e+93) {
                          		tmp = t_1;
                          	} else if (z <= -8e-222) {
                          		tmp = x;
                          	} else if (z <= 1.25e-82) {
                          		tmp = y;
                          	} else if (z <= 1.92e+28) {
                          		tmp = x;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(x, y, z, t, a)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8), intent (in) :: a
                              real(8) :: t_1
                              real(8) :: tmp
                              t_1 = z * (y / (a - t))
                              if (z <= (-1.3d+93)) then
                                  tmp = t_1
                              else if (z <= (-8d-222)) then
                                  tmp = x
                              else if (z <= 1.25d-82) then
                                  tmp = y
                              else if (z <= 1.92d+28) then
                                  tmp = x
                              else
                                  tmp = t_1
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z, double t, double a) {
                          	double t_1 = z * (y / (a - t));
                          	double tmp;
                          	if (z <= -1.3e+93) {
                          		tmp = t_1;
                          	} else if (z <= -8e-222) {
                          		tmp = x;
                          	} else if (z <= 1.25e-82) {
                          		tmp = y;
                          	} else if (z <= 1.92e+28) {
                          		tmp = x;
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z, t, a):
                          	t_1 = z * (y / (a - t))
                          	tmp = 0
                          	if z <= -1.3e+93:
                          		tmp = t_1
                          	elif z <= -8e-222:
                          		tmp = x
                          	elif z <= 1.25e-82:
                          		tmp = y
                          	elif z <= 1.92e+28:
                          		tmp = x
                          	else:
                          		tmp = t_1
                          	return tmp
                          
                          function code(x, y, z, t, a)
                          	t_1 = Float64(z * Float64(y / Float64(a - t)))
                          	tmp = 0.0
                          	if (z <= -1.3e+93)
                          		tmp = t_1;
                          	elseif (z <= -8e-222)
                          		tmp = x;
                          	elseif (z <= 1.25e-82)
                          		tmp = y;
                          	elseif (z <= 1.92e+28)
                          		tmp = x;
                          	else
                          		tmp = t_1;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z, t, a)
                          	t_1 = z * (y / (a - t));
                          	tmp = 0.0;
                          	if (z <= -1.3e+93)
                          		tmp = t_1;
                          	elseif (z <= -8e-222)
                          		tmp = x;
                          	elseif (z <= 1.25e-82)
                          		tmp = y;
                          	elseif (z <= 1.92e+28)
                          		tmp = x;
                          	else
                          		tmp = t_1;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+93], t$95$1, If[LessEqual[z, -8e-222], x, If[LessEqual[z, 1.25e-82], y, If[LessEqual[z, 1.92e+28], x, t$95$1]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := z \cdot \frac{y}{a - t}\\
                          \mathbf{if}\;z \leq -1.3 \cdot 10^{+93}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;z \leq -8 \cdot 10^{-222}:\\
                          \;\;\;\;x\\
                          
                          \mathbf{elif}\;z \leq 1.25 \cdot 10^{-82}:\\
                          \;\;\;\;y\\
                          
                          \mathbf{elif}\;z \leq 1.92 \cdot 10^{+28}:\\
                          \;\;\;\;x\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if z < -1.3e93 or 1.91999999999999998e28 < z

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

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

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

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

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

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

                              \[\leadsto \frac{z \cdot y}{a - t} \]
                            6. Step-by-step derivation
                              1. Applied rewrites34.1%

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

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

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

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

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

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

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

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

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

                              if -1.3e93 < z < -8.00000000000000038e-222 or 1.25e-82 < z < 1.91999999999999998e28

                              1. Initial program 68.5%

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

                                \[\leadsto \color{blue}{x} \]
                              3. Step-by-step derivation
                                1. Applied rewrites29.5%

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

                                if -8.00000000000000038e-222 < z < 1.25e-82

                                1. Initial program 64.3%

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

                                  \[\leadsto \color{blue}{y} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites37.9%

                                    \[\leadsto \color{blue}{y} \]
                                4. Recombined 3 regimes into one program.
                                5. Add Preprocessing

                                Alternative 14: 36.4% accurate, 1.0× speedup?

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

                                  1. Initial program 68.0%

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

                                    \[\leadsto \color{blue}{x} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites47.7%

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

                                    if -2.29999999999999984e28 < a < 6.19999999999999969e-151

                                    1. Initial program 64.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto z \cdot \frac{x - y}{t} \]
                                    7. Applied rewrites42.1%

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

                                    if 6.19999999999999969e-151 < a < 2.70000000000000016e105

                                    1. Initial program 69.4%

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

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

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

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

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

                                      \[\leadsto \frac{y}{x} \cdot x \]
                                    6. Step-by-step derivation
                                      1. lower-/.f6423.9

                                        \[\leadsto \frac{y}{x} \cdot x \]
                                    7. Applied rewrites23.9%

                                      \[\leadsto \frac{y}{x} \cdot x \]
                                  4. Recombined 3 regimes into one program.
                                  5. Add Preprocessing

                                  Alternative 15: 35.5% accurate, 0.8× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{z}{a}\\ \mathbf{if}\;z \leq -2.7 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-222}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-82}:\\ \;\;\;\;y\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+134}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a)
                                   :precision binary64
                                   (let* ((t_1 (* y (/ z a))))
                                     (if (<= z -2.7e+93)
                                       t_1
                                       (if (<= z -8e-222) x (if (<= z 1.25e-82) y (if (<= z 7e+134) x t_1))))))
                                  double code(double x, double y, double z, double t, double a) {
                                  	double t_1 = y * (z / a);
                                  	double tmp;
                                  	if (z <= -2.7e+93) {
                                  		tmp = t_1;
                                  	} else if (z <= -8e-222) {
                                  		tmp = x;
                                  	} else if (z <= 1.25e-82) {
                                  		tmp = y;
                                  	} else if (z <= 7e+134) {
                                  		tmp = x;
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y, z, t, a)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      real(8), intent (in) :: z
                                      real(8), intent (in) :: t
                                      real(8), intent (in) :: a
                                      real(8) :: t_1
                                      real(8) :: tmp
                                      t_1 = y * (z / a)
                                      if (z <= (-2.7d+93)) then
                                          tmp = t_1
                                      else if (z <= (-8d-222)) then
                                          tmp = x
                                      else if (z <= 1.25d-82) then
                                          tmp = y
                                      else if (z <= 7d+134) then
                                          tmp = x
                                      else
                                          tmp = t_1
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double x, double y, double z, double t, double a) {
                                  	double t_1 = y * (z / a);
                                  	double tmp;
                                  	if (z <= -2.7e+93) {
                                  		tmp = t_1;
                                  	} else if (z <= -8e-222) {
                                  		tmp = x;
                                  	} else if (z <= 1.25e-82) {
                                  		tmp = y;
                                  	} else if (z <= 7e+134) {
                                  		tmp = x;
                                  	} else {
                                  		tmp = t_1;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(x, y, z, t, a):
                                  	t_1 = y * (z / a)
                                  	tmp = 0
                                  	if z <= -2.7e+93:
                                  		tmp = t_1
                                  	elif z <= -8e-222:
                                  		tmp = x
                                  	elif z <= 1.25e-82:
                                  		tmp = y
                                  	elif z <= 7e+134:
                                  		tmp = x
                                  	else:
                                  		tmp = t_1
                                  	return tmp
                                  
                                  function code(x, y, z, t, a)
                                  	t_1 = Float64(y * Float64(z / a))
                                  	tmp = 0.0
                                  	if (z <= -2.7e+93)
                                  		tmp = t_1;
                                  	elseif (z <= -8e-222)
                                  		tmp = x;
                                  	elseif (z <= 1.25e-82)
                                  		tmp = y;
                                  	elseif (z <= 7e+134)
                                  		tmp = x;
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(x, y, z, t, a)
                                  	t_1 = y * (z / a);
                                  	tmp = 0.0;
                                  	if (z <= -2.7e+93)
                                  		tmp = t_1;
                                  	elseif (z <= -8e-222)
                                  		tmp = x;
                                  	elseif (z <= 1.25e-82)
                                  		tmp = y;
                                  	elseif (z <= 7e+134)
                                  		tmp = x;
                                  	else
                                  		tmp = t_1;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+93], t$95$1, If[LessEqual[z, -8e-222], x, If[LessEqual[z, 1.25e-82], y, If[LessEqual[z, 7e+134], x, t$95$1]]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_1 := y \cdot \frac{z}{a}\\
                                  \mathbf{if}\;z \leq -2.7 \cdot 10^{+93}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  \mathbf{elif}\;z \leq -8 \cdot 10^{-222}:\\
                                  \;\;\;\;x\\
                                  
                                  \mathbf{elif}\;z \leq 1.25 \cdot 10^{-82}:\\
                                  \;\;\;\;y\\
                                  
                                  \mathbf{elif}\;z \leq 7 \cdot 10^{+134}:\\
                                  \;\;\;\;x\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;t\_1\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if z < -2.6999999999999999e93 or 7.00000000000000006e134 < z

                                    1. Initial program 67.6%

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

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

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

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

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

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

                                      \[\leadsto \frac{z \cdot y}{a - t} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites35.2%

                                        \[\leadsto \frac{z \cdot y}{a - t} \]
                                      2. Taylor expanded in t around 0

                                        \[\leadsto \frac{y \cdot z}{\color{blue}{a}} \]
                                      3. Step-by-step derivation
                                        1. associate-/l*N/A

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

                                          \[\leadsto y \cdot \frac{z}{\color{blue}{a}} \]
                                        3. lower-/.f6433.7

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

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

                                      if -2.6999999999999999e93 < z < -8.00000000000000038e-222 or 1.25e-82 < z < 7.00000000000000006e134

                                      1. Initial program 68.2%

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

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

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

                                        if -8.00000000000000038e-222 < z < 1.25e-82

                                        1. Initial program 64.3%

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

                                          \[\leadsto \color{blue}{y} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites37.9%

                                            \[\leadsto \color{blue}{y} \]
                                        4. Recombined 3 regimes into one program.
                                        5. Add Preprocessing

                                        Alternative 16: 34.9% accurate, 1.0× speedup?

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

                                          1. Initial program 67.7%

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

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

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

                                            if -4.4999999999999998e38 < a < -2.0000000000000002e-192

                                            1. Initial program 66.3%

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

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

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

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

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

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

                                              \[\leadsto \frac{z \cdot y}{a - t} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites24.8%

                                                \[\leadsto \frac{z \cdot y}{a - t} \]
                                              2. Taylor expanded in t around 0

                                                \[\leadsto \frac{y \cdot z}{\color{blue}{a}} \]
                                              3. Step-by-step derivation
                                                1. associate-/l*N/A

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

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

                                                  \[\leadsto y \cdot \frac{z}{a} \]
                                              4. Applied rewrites19.6%

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

                                              if -2.0000000000000002e-192 < a < 2.70000000000000016e105

                                              1. Initial program 66.7%

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

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

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

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

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

                                                \[\leadsto \frac{y}{x} \cdot x \]
                                              6. Step-by-step derivation
                                                1. lower-/.f6430.2

                                                  \[\leadsto \frac{y}{x} \cdot x \]
                                              7. Applied rewrites30.2%

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

                                            Alternative 17: 32.4% accurate, 2.1× speedup?

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

                                              1. Initial program 68.1%

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

                                                \[\leadsto \color{blue}{x} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites46.7%

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

                                                if -5e7 < a < 2.70000000000000016e105

                                                1. Initial program 66.3%

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

                                                  \[\leadsto \color{blue}{y} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites33.0%

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

                                                Alternative 18: 24.9% accurate, 17.9× speedup?

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

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

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

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

                                                  Reproduce

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