Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E

Percentage Accurate: 92.8% → 97.1%
Time: 3.3s
Alternatives: 11
Speedup: 1.1×

Specification

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

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

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

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

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

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

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

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

Alternative 1: 97.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(z - t, \frac{y}{a}, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma (- z t) (/ y a) x))
double code(double x, double y, double z, double t, double a) {
	return fma((z - t), (y / a), x);
}
function code(x, y, z, t, a)
	return fma(Float64(z - t), Float64(y / a), x)
end
code[x_, y_, z_, t_, a_] := N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(z - t, \frac{y}{a}, x\right)
\end{array}
Derivation
  1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 59.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{a} \cdot y\\ t_2 := \frac{y \cdot z}{a}\\ t_3 := \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq -4 \cdot 10^{+127}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+107}:\\ \;\;\;\;x\\ \mathbf{elif}\;t\_3 \leq 10^{+289}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* (/ z a) y)) (t_2 (/ (* y z) a)) (t_3 (/ (* y (- z t)) a)))
   (if (<= t_3 (- INFINITY))
     t_1
     (if (<= t_3 -4e+127)
       t_2
       (if (<= t_3 5e+107) x (if (<= t_3 1e+289) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z / a) * y;
	double t_2 = (y * z) / a;
	double t_3 = (y * (z - t)) / a;
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_3 <= -4e+127) {
		tmp = t_2;
	} else if (t_3 <= 5e+107) {
		tmp = x;
	} else if (t_3 <= 1e+289) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (z / a) * y;
	double t_2 = (y * z) / a;
	double t_3 = (y * (z - t)) / a;
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_3 <= -4e+127) {
		tmp = t_2;
	} else if (t_3 <= 5e+107) {
		tmp = x;
	} else if (t_3 <= 1e+289) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z / a) * y
	t_2 = (y * z) / a
	t_3 = (y * (z - t)) / a
	tmp = 0
	if t_3 <= -math.inf:
		tmp = t_1
	elif t_3 <= -4e+127:
		tmp = t_2
	elif t_3 <= 5e+107:
		tmp = x
	elif t_3 <= 1e+289:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z / a) * y)
	t_2 = Float64(Float64(y * z) / a)
	t_3 = Float64(Float64(y * Float64(z - t)) / a)
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_3 <= -4e+127)
		tmp = t_2;
	elseif (t_3 <= 5e+107)
		tmp = x;
	elseif (t_3 <= 1e+289)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z / a) * y;
	t_2 = (y * z) / a;
	t_3 = (y * (z - t)) / a;
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = t_1;
	elseif (t_3 <= -4e+127)
		tmp = t_2;
	elseif (t_3 <= 5e+107)
		tmp = x;
	elseif (t_3 <= 1e+289)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -4e+127], t$95$2, If[LessEqual[t$95$3, 5e+107], x, If[LessEqual[t$95$3, 1e+289], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z}{a} \cdot y\\
t_2 := \frac{y \cdot z}{a}\\
t_3 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_3 \leq -4 \cdot 10^{+127}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+107}:\\
\;\;\;\;x\\

\mathbf{elif}\;t\_3 \leq 10^{+289}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -inf.0 or 1.0000000000000001e289 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 79.3%

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) a) < -3.99999999999999982e127 or 5.0000000000000002e107 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.0000000000000001e289

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto \frac{z}{a} \cdot \color{blue}{y} \]
      4. lower-/.f6428.0

        \[\leadsto \frac{z}{a} \cdot y \]
    4. Applied rewrites28.0%

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

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

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

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

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{a}} \]
      6. lower-*.f6438.6

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

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

    if -3.99999999999999982e127 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000002e107

    1. Initial program 99.3%

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

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

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

    Alternative 3: 85.5% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a}\\ t_2 := \frac{y}{a} \cdot \left(z - t\right)\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+159}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-90}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+106}:\\ \;\;\;\;x - y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (/ y a) (- z t))))
       (if (<= t_1 -5e+159)
         t_2
         (if (<= t_1 2e-90)
           (fma (/ y a) z x)
           (if (<= t_1 1e+106) (- x (* y (/ t a))) t_2)))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = (y * (z - t)) / a;
    	double t_2 = (y / a) * (z - t);
    	double tmp;
    	if (t_1 <= -5e+159) {
    		tmp = t_2;
    	} else if (t_1 <= 2e-90) {
    		tmp = fma((y / a), z, x);
    	} else if (t_1 <= 1e+106) {
    		tmp = x - (y * (t / a));
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(y * Float64(z - t)) / a)
    	t_2 = Float64(Float64(y / a) * Float64(z - t))
    	tmp = 0.0
    	if (t_1 <= -5e+159)
    		tmp = t_2;
    	elseif (t_1 <= 2e-90)
    		tmp = fma(Float64(y / a), z, x);
    	elseif (t_1 <= 1e+106)
    		tmp = Float64(x - Float64(y * Float64(t / a)));
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+159], t$95$2, If[LessEqual[t$95$1, 2e-90], N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+106], N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
    t_2 := \frac{y}{a} \cdot \left(z - t\right)\\
    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{+159}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-90}:\\
    \;\;\;\;\mathsf{fma}\left(\frac{y}{a}, z, x\right)\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+106}:\\
    \;\;\;\;x - y \cdot \frac{t}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -5.00000000000000003e159 or 1.00000000000000009e106 < (/.f64 (*.f64 y (-.f64 z t)) a)

      1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000003e159 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999999e-90

      1. Initial program 99.2%

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

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

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

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

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

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

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

      if 1.99999999999999999e-90 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.00000000000000009e106

      1. Initial program 99.7%

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

        \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{a}} \]
      3. Step-by-step derivation
        1. cancel-sign-subN/A

          \[\leadsto x - \color{blue}{\left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{t \cdot y}{a}} \]
        2. metadata-evalN/A

          \[\leadsto x - 1 \cdot \frac{\color{blue}{t \cdot y}}{a} \]
        3. *-lft-identityN/A

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

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

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

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

          \[\leadsto x - y \cdot \color{blue}{\frac{t}{a}} \]
        8. lower-/.f6472.9

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

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

    Alternative 4: 84.5% accurate, 0.3× speedup?

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

      1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000003e159 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.99999999999999989e-20

      1. Initial program 99.2%

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

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

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

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

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

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

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

    Alternative 5: 60.1% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a}\\ t_2 := \frac{y}{a} \cdot z\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+127}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t a)
     :precision binary64
     (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (/ y a) z)))
       (if (<= t_1 -4e+127) t_2 (if (<= t_1 5e+107) x t_2))))
    double code(double x, double y, double z, double t, double a) {
    	double t_1 = (y * (z - t)) / a;
    	double t_2 = (y / a) * z;
    	double tmp;
    	if (t_1 <= -4e+127) {
    		tmp = t_2;
    	} else if (t_1 <= 5e+107) {
    		tmp = x;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8) :: t_1
        real(8) :: t_2
        real(8) :: tmp
        t_1 = (y * (z - t)) / a
        t_2 = (y / a) * z
        if (t_1 <= (-4d+127)) then
            tmp = t_2
        else if (t_1 <= 5d+107) then
            tmp = x
        else
            tmp = t_2
        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 - t)) / a;
    	double t_2 = (y / a) * z;
    	double tmp;
    	if (t_1 <= -4e+127) {
    		tmp = t_2;
    	} else if (t_1 <= 5e+107) {
    		tmp = x;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a):
    	t_1 = (y * (z - t)) / a
    	t_2 = (y / a) * z
    	tmp = 0
    	if t_1 <= -4e+127:
    		tmp = t_2
    	elif t_1 <= 5e+107:
    		tmp = x
    	else:
    		tmp = t_2
    	return tmp
    
    function code(x, y, z, t, a)
    	t_1 = Float64(Float64(y * Float64(z - t)) / a)
    	t_2 = Float64(Float64(y / a) * z)
    	tmp = 0.0
    	if (t_1 <= -4e+127)
    		tmp = t_2;
    	elseif (t_1 <= 5e+107)
    		tmp = x;
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a)
    	t_1 = (y * (z - t)) / a;
    	t_2 = (y / a) * z;
    	tmp = 0.0;
    	if (t_1 <= -4e+127)
    		tmp = t_2;
    	elseif (t_1 <= 5e+107)
    		tmp = x;
    	else
    		tmp = t_2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+127], t$95$2, If[LessEqual[t$95$1, 5e+107], x, t$95$2]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
    t_2 := \frac{y}{a} \cdot z\\
    \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+127}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+107}:\\
    \;\;\;\;x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -3.99999999999999982e127 or 5.0000000000000002e107 < (/.f64 (*.f64 y (-.f64 z t)) a)

      1. Initial program 86.4%

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

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

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

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

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

          \[\leadsto x + \frac{y \cdot \left(z - \color{blue}{1 \cdot t}\right)}{a} \]
        6. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{y}{a} \cdot \color{blue}{z} \]
        3. lift-/.f6450.9

          \[\leadsto \frac{y}{a} \cdot z \]
      6. Applied rewrites50.9%

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

      if -3.99999999999999982e127 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000002e107

      1. Initial program 99.3%

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

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

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

      Alternative 6: 57.7% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a}\\ t_2 := \frac{z}{a} \cdot y\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+127}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+116}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
      (FPCore (x y z t a)
       :precision binary64
       (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (/ z a) y)))
         (if (<= t_1 -4e+127) t_2 (if (<= t_1 1e+116) x t_2))))
      double code(double x, double y, double z, double t, double a) {
      	double t_1 = (y * (z - t)) / a;
      	double t_2 = (z / a) * y;
      	double tmp;
      	if (t_1 <= -4e+127) {
      		tmp = t_2;
      	} else if (t_1 <= 1e+116) {
      		tmp = x;
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, t, a)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: t
          real(8), intent (in) :: a
          real(8) :: t_1
          real(8) :: t_2
          real(8) :: tmp
          t_1 = (y * (z - t)) / a
          t_2 = (z / a) * y
          if (t_1 <= (-4d+127)) then
              tmp = t_2
          else if (t_1 <= 1d+116) then
              tmp = x
          else
              tmp = t_2
          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 - t)) / a;
      	double t_2 = (z / a) * y;
      	double tmp;
      	if (t_1 <= -4e+127) {
      		tmp = t_2;
      	} else if (t_1 <= 1e+116) {
      		tmp = x;
      	} else {
      		tmp = t_2;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t, a):
      	t_1 = (y * (z - t)) / a
      	t_2 = (z / a) * y
      	tmp = 0
      	if t_1 <= -4e+127:
      		tmp = t_2
      	elif t_1 <= 1e+116:
      		tmp = x
      	else:
      		tmp = t_2
      	return tmp
      
      function code(x, y, z, t, a)
      	t_1 = Float64(Float64(y * Float64(z - t)) / a)
      	t_2 = Float64(Float64(z / a) * y)
      	tmp = 0.0
      	if (t_1 <= -4e+127)
      		tmp = t_2;
      	elseif (t_1 <= 1e+116)
      		tmp = x;
      	else
      		tmp = t_2;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t, a)
      	t_1 = (y * (z - t)) / a;
      	t_2 = (z / a) * y;
      	tmp = 0.0;
      	if (t_1 <= -4e+127)
      		tmp = t_2;
      	elseif (t_1 <= 1e+116)
      		tmp = x;
      	else
      		tmp = t_2;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z / a), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+127], t$95$2, If[LessEqual[t$95$1, 1e+116], x, t$95$2]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
      t_2 := \frac{z}{a} \cdot y\\
      \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+127}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq 10^{+116}:\\
      \;\;\;\;x\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (*.f64 y (-.f64 z t)) a) < -3.99999999999999982e127 or 1.00000000000000002e116 < (/.f64 (*.f64 y (-.f64 z t)) a)

        1. Initial program 86.3%

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

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

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

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

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

            \[\leadsto \frac{z}{a} \cdot y \]
        4. Applied rewrites46.3%

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

        if -3.99999999999999982e127 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.00000000000000002e116

        1. Initial program 99.3%

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

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

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

        Alternative 7: 85.9% accurate, 0.7× speedup?

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

          1. Initial program 90.5%

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

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

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

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

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

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

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

          if -1.55000000000000007e-5 < z < 8e21

          1. Initial program 94.9%

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

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

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

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

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

              \[\leadsto x + \frac{y \cdot \left(z - \color{blue}{1 \cdot t}\right)}{a} \]
            6. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 8: 76.1% accurate, 0.7× speedup?

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

            1. Initial program 88.8%

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

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

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

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

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

                \[\leadsto x + \frac{y \cdot \left(z - \color{blue}{1 \cdot t}\right)}{a} \]
              6. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left(\mathsf{neg}\left(t\right)\right) \cdot y}{a} \]
              6. lift-neg.f6459.2

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

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

            if -7.4000000000000005e148 < t < 8.50000000000000007e161

            1. Initial program 94.1%

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

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

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

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

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

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

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

            if 8.50000000000000007e161 < t

            1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{y}{a} \cdot \left(\mathsf{neg}\left(t\right)\right) \]
              9. lower-neg.f6465.8

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

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

          Alternative 9: 76.8% accurate, 0.7× speedup?

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

            1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{y}{a} \cdot \left(\mathsf{neg}\left(t\right)\right) \]
              9. lower-neg.f6465.1

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

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

            if -7.4000000000000005e148 < t < 8.50000000000000007e161

            1. Initial program 94.1%

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

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

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

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

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

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

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

          Alternative 10: 71.2% accurate, 1.3× speedup?

          \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{y}{a}, z, x\right) \end{array} \]
          (FPCore (x y z t a) :precision binary64 (fma (/ y a) z x))
          double code(double x, double y, double z, double t, double a) {
          	return fma((y / a), z, x);
          }
          
          function code(x, y, z, t, a)
          	return fma(Float64(y / a), z, x)
          end
          
          code[x_, y_, z_, t_, a_] := N[(N[(y / a), $MachinePrecision] * z + x), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \mathsf{fma}\left(\frac{y}{a}, z, x\right)
          \end{array}
          
          Derivation
          1. Initial program 92.8%

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

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

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

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

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

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

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

          Alternative 11: 40.0% accurate, 23.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 92.8%

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

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

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

            Developer Target 1: 99.1% accurate, 0.5× speedup?

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

            Reproduce

            ?
            herbie shell --seed 2025093 
            (FPCore (x y z t a)
              :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
              :precision binary64
            
              :alt
              (! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
            
              (+ x (/ (* y (- z t)) a)))