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

Percentage Accurate: 68.5% → 86.5%
Time: 4.2s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 68.5% 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: 86.5% accurate, 0.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.89999999999999985e35 or 0.429999999999999993 < y

    1. Initial program 65.4%

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

        \[\leadsto \color{blue}{x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}} \]
      2. 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{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
      6. lift-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \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. lower-/.f64N/A

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

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

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

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

    if -5.89999999999999985e35 < y < 0.429999999999999993

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

Alternative 2: 91.3% accurate, 0.3× speedup?

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

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

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

    1. Initial program 73.4%

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

        \[\leadsto \color{blue}{x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}} \]
      2. 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{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
      6. lift-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \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. lower-/.f64N/A

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

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

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

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

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

    1. Initial program 4.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{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
      6. lift-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \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. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - x, \left(-z\right) \cdot \left(\frac{t}{\left(a - t\right) \cdot z} - \frac{1}{a - t}\right), x\right) \]
      10. inv-powN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(y - x, \color{blue}{\left(-z\right) \cdot \left(\frac{t}{\left(a - t\right) \cdot z} - {\left(a - t\right)}^{-1}\right)}, x\right) \]
    7. 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}} \]
    8. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

Alternative 3: 64.6% 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 -9.6 \cdot 10^{-27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -8.4 \cdot 10^{-193}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{-11}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{a - 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 -9.6e-27)
     t_1
     (if (<= a -8.4e-193)
       (/ (* (- z t) y) (- a t))
       (if (<= a 3.5e-11) (* (- y x) (/ z (- a 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 <= -9.6e-27) {
		tmp = t_1;
	} else if (a <= -8.4e-193) {
		tmp = ((z - t) * y) / (a - t);
	} else if (a <= 3.5e-11) {
		tmp = (y - x) * (z / (a - 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 <= -9.6e-27)
		tmp = t_1;
	elseif (a <= -8.4e-193)
		tmp = Float64(Float64(Float64(z - t) * y) / Float64(a - t));
	elseif (a <= 3.5e-11)
		tmp = Float64(Float64(y - x) * Float64(z / Float64(a - 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, -9.6e-27], t$95$1, If[LessEqual[a, -8.4e-193], N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-11], N[(N[(y - x), $MachinePrecision] * N[(z / N[(a - t), $MachinePrecision]), $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 -9.6 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -9.60000000000000008e-27 or 3.50000000000000019e-11 < a

    1. Initial program 68.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 + \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--.f6472.9

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

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

    if -9.60000000000000008e-27 < a < -8.3999999999999997e-193

    1. Initial program 68.7%

      \[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--.f6451.8

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

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

    if -8.3999999999999997e-193 < a < 3.50000000000000019e-11

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 60.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -30:\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z}{a}, x\right)\\

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

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

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


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

    1. Initial program 67.5%

      \[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{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
      6. lift-*.f64N/A

        \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \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. lower-/.f64N/A

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

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

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

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

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

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

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

    if -30 < a < -8.3999999999999997e-193

    1. Initial program 69.5%

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

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

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

    if -8.3999999999999997e-193 < a < 3.0999999999999999e-15

    1. Initial program 68.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--.f6454.6

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.0999999999999999e-15 < a

    1. Initial program 68.8%

      \[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--.f6463.8

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

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

Alternative 5: 83.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+199}:\\
\;\;\;\;y\\

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

\mathbf{else}:\\
\;\;\;\;y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.54999999999999993e199 or 3.50000000000000008e188 < t

    1. Initial program 27.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} \]
    3. Step-by-step derivation
      1. Applied rewrites59.8%

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

      if -1.54999999999999993e199 < t < 3.50000000000000008e188

      1. Initial program 77.7%

        \[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{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
        6. lift-*.f64N/A

          \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \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. lower-/.f64N/A

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

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

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

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

    Alternative 6: 59.2% accurate, 0.9× speedup?

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

      1. Initial program 31.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} \]
      3. Step-by-step derivation
        1. Applied rewrites56.2%

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

        if -6.2999999999999999e180 < t < 9.50000000000000031e137

        1. Initial program 80.2%

          \[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{\left(y - x\right) \cdot \color{blue}{\left(z - t\right)}}{a - t} \]
          6. lift-*.f64N/A

            \[\leadsto x + \frac{\color{blue}{\left(y - x\right) \cdot \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. lower-/.f64N/A

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

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

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

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

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

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

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

      Alternative 7: 58.1% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6.3 \cdot 10^{+180}:\\ \;\;\;\;y\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+137}:\\ \;\;\;\;\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 -6.3e+180) y (if (<= t 9.5e+137) (fma z (/ (- y x) a) x) y)))
      double code(double x, double y, double z, double t, double a) {
      	double tmp;
      	if (t <= -6.3e+180) {
      		tmp = y;
      	} else if (t <= 9.5e+137) {
      		tmp = fma(z, ((y - x) / a), x);
      	} else {
      		tmp = y;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a)
      	tmp = 0.0
      	if (t <= -6.3e+180)
      		tmp = y;
      	elseif (t <= 9.5e+137)
      		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, -6.3e+180], y, If[LessEqual[t, 9.5e+137], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], y]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -6.3 \cdot 10^{+180}:\\
      \;\;\;\;y\\
      
      \mathbf{elif}\;t \leq 9.5 \cdot 10^{+137}:\\
      \;\;\;\;\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 < -6.2999999999999999e180 or 9.50000000000000031e137 < t

        1. Initial program 31.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} \]
        3. Step-by-step derivation
          1. Applied rewrites56.2%

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

          if -6.2999999999999999e180 < t < 9.50000000000000031e137

          1. Initial program 80.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--.f6458.8

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

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

        Alternative 8: 38.4% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -6.4 \cdot 10^{+153}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -3.5 \cdot 10^{-14}:\\ \;\;\;\;\left(y - x\right) \cdot \frac{z}{a}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-10}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
        (FPCore (x y z t a)
         :precision binary64
         (if (<= a -6.4e+153)
           x
           (if (<= a -3.5e-14) (* (- y x) (/ z a)) (if (<= a 1.6e-10) y x))))
        double code(double x, double y, double z, double t, double a) {
        	double tmp;
        	if (a <= -6.4e+153) {
        		tmp = x;
        	} else if (a <= -3.5e-14) {
        		tmp = (y - x) * (z / a);
        	} else if (a <= 1.6e-10) {
        		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 <= (-6.4d+153)) then
                tmp = x
            else if (a <= (-3.5d-14)) then
                tmp = (y - x) * (z / a)
            else if (a <= 1.6d-10) 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 <= -6.4e+153) {
        		tmp = x;
        	} else if (a <= -3.5e-14) {
        		tmp = (y - x) * (z / a);
        	} else if (a <= 1.6e-10) {
        		tmp = y;
        	} else {
        		tmp = x;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a):
        	tmp = 0
        	if a <= -6.4e+153:
        		tmp = x
        	elif a <= -3.5e-14:
        		tmp = (y - x) * (z / a)
        	elif a <= 1.6e-10:
        		tmp = y
        	else:
        		tmp = x
        	return tmp
        
        function code(x, y, z, t, a)
        	tmp = 0.0
        	if (a <= -6.4e+153)
        		tmp = x;
        	elseif (a <= -3.5e-14)
        		tmp = Float64(Float64(y - x) * Float64(z / a));
        	elseif (a <= 1.6e-10)
        		tmp = y;
        	else
        		tmp = x;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a)
        	tmp = 0.0;
        	if (a <= -6.4e+153)
        		tmp = x;
        	elseif (a <= -3.5e-14)
        		tmp = (y - x) * (z / a);
        	elseif (a <= 1.6e-10)
        		tmp = y;
        	else
        		tmp = x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.4e+153], x, If[LessEqual[a, -3.5e-14], N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e-10], y, x]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a \leq -6.4 \cdot 10^{+153}:\\
        \;\;\;\;x\\
        
        \mathbf{elif}\;a \leq -3.5 \cdot 10^{-14}:\\
        \;\;\;\;\left(y - x\right) \cdot \frac{z}{a}\\
        
        \mathbf{elif}\;a \leq 1.6 \cdot 10^{-10}:\\
        \;\;\;\;y\\
        
        \mathbf{else}:\\
        \;\;\;\;x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if a < -6.4000000000000003e153 or 1.5999999999999999e-10 < 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 rewrites47.1%

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

            if -6.4000000000000003e153 < a < -3.5000000000000002e-14

            1. Initial program 69.7%

              \[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--.f6432.3

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(y - x\right) \cdot \frac{z}{a} \]
            9. Applied rewrites31.6%

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

            if -3.5000000000000002e-14 < a < 1.5999999999999999e-10

            1. Initial program 68.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 rewrites33.8%

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

            Alternative 9: 38.0% accurate, 2.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -0.00029:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-10}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
            (FPCore (x y z t a)
             :precision binary64
             (if (<= a -0.00029) x (if (<= a 1.6e-10) y x)))
            double code(double x, double y, double z, double t, double a) {
            	double tmp;
            	if (a <= -0.00029) {
            		tmp = x;
            	} else if (a <= 1.6e-10) {
            		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 <= (-0.00029d0)) then
                    tmp = x
                else if (a <= 1.6d-10) 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 <= -0.00029) {
            		tmp = x;
            	} else if (a <= 1.6e-10) {
            		tmp = y;
            	} else {
            		tmp = x;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a):
            	tmp = 0
            	if a <= -0.00029:
            		tmp = x
            	elif a <= 1.6e-10:
            		tmp = y
            	else:
            		tmp = x
            	return tmp
            
            function code(x, y, z, t, a)
            	tmp = 0.0
            	if (a <= -0.00029)
            		tmp = x;
            	elseif (a <= 1.6e-10)
            		tmp = y;
            	else
            		tmp = x;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a)
            	tmp = 0.0;
            	if (a <= -0.00029)
            		tmp = x;
            	elseif (a <= 1.6e-10)
            		tmp = y;
            	else
            		tmp = x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_] := If[LessEqual[a, -0.00029], x, If[LessEqual[a, 1.6e-10], y, x]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq -0.00029:\\
            \;\;\;\;x\\
            
            \mathbf{elif}\;a \leq 1.6 \cdot 10^{-10}:\\
            \;\;\;\;y\\
            
            \mathbf{else}:\\
            \;\;\;\;x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -2.9e-4 or 1.5999999999999999e-10 < 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 rewrites42.4%

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

                if -2.9e-4 < a < 1.5999999999999999e-10

                1. Initial program 68.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} \]
                3. Step-by-step derivation
                  1. Applied rewrites33.6%

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

                Alternative 10: 25.1% accurate, 29.0× 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 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 rewrites25.1%

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

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

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\ \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (x y z t a)
                   :precision binary64
                   (let* ((t_1 (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
                     (if (< a -1.6153062845442575e-142)
                       t_1
                       (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) t_1))))
                  double code(double x, double y, double z, double t, double a) {
                  	double t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
                  	double tmp;
                  	if (a < -1.6153062845442575e-142) {
                  		tmp = t_1;
                  	} else if (a < 3.774403170083174e-182) {
                  		tmp = y - ((z / t) * (y - 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 = x + (((y - x) / 1.0d0) * ((z - t) / (a - t)))
                      if (a < (-1.6153062845442575d-142)) then
                          tmp = t_1
                      else if (a < 3.774403170083174d-182) then
                          tmp = y - ((z / t) * (y - 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 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
                  	double tmp;
                  	if (a < -1.6153062845442575e-142) {
                  		tmp = t_1;
                  	} else if (a < 3.774403170083174e-182) {
                  		tmp = y - ((z / t) * (y - x));
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a):
                  	t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)))
                  	tmp = 0
                  	if a < -1.6153062845442575e-142:
                  		tmp = t_1
                  	elif a < 3.774403170083174e-182:
                  		tmp = y - ((z / t) * (y - x))
                  	else:
                  		tmp = t_1
                  	return tmp
                  
                  function code(x, y, z, t, a)
                  	t_1 = Float64(x + Float64(Float64(Float64(y - x) / 1.0) * Float64(Float64(z - t) / Float64(a - t))))
                  	tmp = 0.0
                  	if (a < -1.6153062845442575e-142)
                  		tmp = t_1;
                  	elseif (a < 3.774403170083174e-182)
                  		tmp = Float64(y - Float64(Float64(z / t) * Float64(y - x)));
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a)
                  	t_1 = x + (((y - x) / 1.0) * ((z - t) / (a - t)));
                  	tmp = 0.0;
                  	if (a < -1.6153062845442575e-142)
                  		tmp = t_1;
                  	elseif (a < 3.774403170083174e-182)
                  		tmp = y - ((z / t) * (y - x));
                  	else
                  		tmp = t_1;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - x), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[a, -1.6153062845442575e-142], t$95$1, If[Less[a, 3.774403170083174e-182], N[(y - N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_1 := x + \frac{y - x}{1} \cdot \frac{z - t}{a - t}\\
                  \mathbf{if}\;a < -1.6153062845442575 \cdot 10^{-142}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;a < 3.774403170083174 \cdot 10^{-182}:\\
                  \;\;\;\;y - \frac{z}{t} \cdot \left(y - x\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  

                  Reproduce

                  ?
                  herbie shell --seed 2025106 
                  (FPCore (x y z t a)
                    :name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
                    :precision binary64
                  
                    :alt
                    (! :herbie-platform default (if (< a -646122513817703/4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 1887201585041587/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))))))
                  
                    (+ x (/ (* (- y x) (- z t)) (- a t))))