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

Percentage Accurate: 93.4% → 99.5%
Time: 3.0s
Alternatives: 10
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 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: 93.4% 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: 99.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;t\_2\\

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


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

    1. Initial program 81.2%

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\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-/.f6499.7

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) a)) < 1.9999999999999999e298

    1. Initial program 99.4%

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

Alternative 2: 99.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;x + \frac{z \cdot y - t \cdot y}{a}\\

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


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

    1. Initial program 82.2%

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\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-/.f6499.3

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) a)) < 1.99999999999999989e273

    1. Initial program 99.4%

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

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

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\frac{z \cdot z - t \cdot t}{z + t}}}{a} \]
      4. flip--N/A

        \[\leadsto x + \frac{y \cdot \color{blue}{\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. mul-1-negN/A

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{z \cdot y} - t \cdot y}{a} \]
      15. lower-*.f6499.4

        \[\leadsto x + \frac{z \cdot y - \color{blue}{t \cdot y}}{a} \]
    3. Applied rewrites99.4%

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

Alternative 3: 97.3% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 7.000000000000001e-188

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\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.3

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

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

    if 7.000000000000001e-188 < a

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 96.7% 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 93.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{\color{blue}{y \cdot \left(z - t\right)}}{a} \]
    4. lift--.f64N/A

      \[\leadsto x + \frac{y \cdot \color{blue}{\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.3

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

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

Alternative 5: 84.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{z - t}{a} \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+298}:\\
\;\;\;\;\frac{\left(z - t\right) \cdot y}{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) < -9.9999999999999998e100 or 1.9999999999999999e298 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{a} \cdot y \]
      8. lift--.f6486.5

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

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

    if -9.9999999999999998e100 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1e16

    1. Initial program 99.3%

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

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

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

    if 1e16 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1.9999999999999999e298

    1. Initial program 99.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--.f6474.2

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

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

Alternative 6: 83.6% 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 -3.6 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-83}:\\ \;\;\;\;x - y \cdot \frac{t}{a}\\ \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 -3.6e+14) t_1 (if (<= z 4.2e-83) (- x (* y (/ t a))) 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 <= -3.6e+14) {
		tmp = t_1;
	} else if (z <= 4.2e-83) {
		tmp = x - (y * (t / a));
	} 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 <= -3.6e+14)
		tmp = t_1;
	elseif (z <= 4.2e-83)
		tmp = Float64(x - Float64(y * Float64(t / a)));
	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, -3.6e+14], t$95$1, If[LessEqual[z, 4.2e-83], N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $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 -3.6 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-83}:\\
\;\;\;\;x - y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6e14 or 4.1999999999999998e-83 < z

    1. Initial program 91.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-/.f6481.0

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

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

    if -3.6e14 < z < 4.1999999999999998e-83

    1. Initial program 95.9%

      \[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-/.f6487.0

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

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

Alternative 7: 82.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{z - t}{a} \cdot y\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, y, 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) < -1e114 or 5.0000000000000004e49 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{z - t}{a} \cdot y \]
      8. lift--.f6480.4

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

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

    if -1e114 < (/.f64 (*.f64 y (-.f64 z t)) a) < 5.0000000000000004e49

    1. Initial program 99.3%

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\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-/.f6496.9

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

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

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

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

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

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

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

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

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

Alternative 8: 76.9% accurate, 0.7× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \frac{t}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.1e167

    1. Initial program 89.8%

      \[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.f6467.4

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

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

    if -3.1e167 < t < 4.5e227

    1. Initial program 94.3%

      \[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-/.f6479.0

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

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

    if 4.5e227 < t

    1. Initial program 88.8%

      \[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.f6473.0

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

      \[\leadsto \color{blue}{\frac{y}{a} \cdot \left(-t\right)} \]
    5. Step-by-step derivation
      1. *-commutative73.0

        \[\leadsto \frac{y}{a} \cdot \left(-t\right) \]
      2. associate-*r/73.0

        \[\leadsto \frac{y}{\color{blue}{a}} \cdot \left(-t\right) \]
      3. +-commutative73.0

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 57.2% accurate, 0.4× 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 -1 \cdot 10^{+101}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 10^{+16}:\\ \;\;\;\;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 -1e+101) t_2 (if (<= t_1 1e+16) 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 <= -1e+101) {
		tmp = t_2;
	} else if (t_1 <= 1e+16) {
		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 <= (-1d+101)) then
        tmp = t_2
    else if (t_1 <= 1d+16) 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 <= -1e+101) {
		tmp = t_2;
	} else if (t_1 <= 1e+16) {
		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 <= -1e+101:
		tmp = t_2
	elif t_1 <= 1e+16:
		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 <= -1e+101)
		tmp = t_2;
	elseif (t_1 <= 1e+16)
		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 <= -1e+101)
		tmp = t_2;
	elseif (t_1 <= 1e+16)
		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, -1e+101], t$95$2, If[LessEqual[t$95$1, 1e+16], 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 -1 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 10^{+16}:\\
\;\;\;\;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) < -9.9999999999999998e100 or 1e16 < (/.f64 (*.f64 y (-.f64 z t)) a)

    1. Initial program 89.0%

      \[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-/.f6445.2

        \[\leadsto \frac{z}{a} \cdot y \]
    4. Applied rewrites45.2%

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

    if -9.9999999999999998e100 < (/.f64 (*.f64 y (-.f64 z t)) a) < 1e16

    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 rewrites73.1%

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

    Alternative 10: 39.0% accurate, 12.7× 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 93.4%

      \[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 rewrites39.0%

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

      Reproduce

      ?
      herbie shell --seed 2025112 
      (FPCore (x y z t a)
        :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
        :precision binary64
        (+ x (/ (* y (- z t)) a)))