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

Percentage Accurate: 92.5% → 98.7%
Time: 5.3s
Alternatives: 9
Speedup: 1.1×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

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 9 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.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 98.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+232}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 2.00000000000000011e232

    1. Initial program 99.3%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing

    if 2.00000000000000011e232 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 81.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+27} \lor \neg \left(t \leq 1.5 \cdot 10^{+117}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.0000000000000004e27 or 1.5e117 < t

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -7.0000000000000004e27 < t < 1.5e117

      1. Initial program 98.5%

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

        \[\leadsto \color{blue}{y \cdot \left(\frac{z}{t} - \frac{x}{t}\right)} \]
      4. Step-by-step derivation
        1. Applied rewrites83.2%

          \[\leadsto \color{blue}{\frac{\left(z - x\right) \cdot y}{t}} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification85.5%

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7 \cdot 10^{+27} \lor \neg \left(t \leq 1.5 \cdot 10^{+117}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \end{array} \]
      7. Add Preprocessing

      Alternative 3: 85.7% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -65000000 \lor \neg \left(z \leq 8.5 \cdot 10^{-91}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (or (<= z -65000000.0) (not (<= z 8.5e-91)))
         (fma (/ y t) z x)
         (* (- 1.0 (/ y t)) x)))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if ((z <= -65000000.0) || !(z <= 8.5e-91)) {
      		tmp = fma((y / t), z, x);
      	} else {
      		tmp = (1.0 - (y / t)) * x;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if ((z <= -65000000.0) || !(z <= 8.5e-91))
      		tmp = fma(Float64(y / t), z, x);
      	else
      		tmp = Float64(Float64(1.0 - Float64(y / t)) * x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -65000000.0], N[Not[LessEqual[z, 8.5e-91]], $MachinePrecision]], N[(N[(y / t), $MachinePrecision] * z + x), $MachinePrecision], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -65000000 \lor \neg \left(z \leq 8.5 \cdot 10^{-91}\right):\\
      \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -6.5e7 or 8.49999999999999985e-91 < z

        1. Initial program 89.7%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \color{blue}{z}, x\right) \]
        6. Step-by-step derivation
          1. Applied rewrites86.4%

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

          if -6.5e7 < z < 8.49999999999999985e-91

          1. Initial program 98.9%

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

            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites82.8%

              \[\leadsto \color{blue}{\left(1 - \frac{y}{t}\right) \cdot x} \]
          5. Recombined 2 regimes into one program.
          6. Final simplification84.9%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -65000000 \lor \neg \left(z \leq 8.5 \cdot 10^{-91}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{t}, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\ \end{array} \]
          7. Add Preprocessing

          Alternative 4: 83.4% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -420000000000:\\ \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{elif}\;y \leq 2.44 \cdot 10^{-42}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z - x}{t} \cdot y\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= y -420000000000.0)
             (* (/ y t) (- z x))
             (if (<= y 2.44e-42) (+ x (/ (* y z) t)) (* (/ (- z x) t) y))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= -420000000000.0) {
          		tmp = (y / t) * (z - x);
          	} else if (y <= 2.44e-42) {
          		tmp = x + ((y * z) / t);
          	} else {
          		tmp = ((z - x) / t) * y;
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, t)
          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) :: tmp
              if (y <= (-420000000000.0d0)) then
                  tmp = (y / t) * (z - x)
              else if (y <= 2.44d-42) then
                  tmp = x + ((y * z) / t)
              else
                  tmp = ((z - x) / t) * y
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= -420000000000.0) {
          		tmp = (y / t) * (z - x);
          	} else if (y <= 2.44e-42) {
          		tmp = x + ((y * z) / t);
          	} else {
          		tmp = ((z - x) / t) * y;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if y <= -420000000000.0:
          		tmp = (y / t) * (z - x)
          	elif y <= 2.44e-42:
          		tmp = x + ((y * z) / t)
          	else:
          		tmp = ((z - x) / t) * y
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (y <= -420000000000.0)
          		tmp = Float64(Float64(y / t) * Float64(z - x));
          	elseif (y <= 2.44e-42)
          		tmp = Float64(x + Float64(Float64(y * z) / t));
          	else
          		tmp = Float64(Float64(Float64(z - x) / t) * y);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (y <= -420000000000.0)
          		tmp = (y / t) * (z - x);
          	elseif (y <= 2.44e-42)
          		tmp = x + ((y * z) / t);
          	else
          		tmp = ((z - x) / t) * y;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[y, -420000000000.0], N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.44e-42], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -420000000000:\\
          \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\
          
          \mathbf{elif}\;y \leq 2.44 \cdot 10^{-42}:\\
          \;\;\;\;x + \frac{y \cdot z}{t}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{z - x}{t} \cdot y\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -4.2e11

            1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{y \cdot \left(\frac{z}{t} - \frac{x}{t}\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites75.0%

                \[\leadsto \color{blue}{\frac{\left(z - x\right) \cdot y}{t}} \]
              2. Step-by-step derivation
                1. Applied rewrites87.9%

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

                if -4.2e11 < y < 2.44000000000000015e-42

                1. Initial program 99.1%

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

                  \[\leadsto x + \frac{y \cdot \color{blue}{z}}{t} \]
                4. Step-by-step derivation
                  1. Applied rewrites92.0%

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

                  if 2.44000000000000015e-42 < y

                  1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto x + \frac{y \cdot \left(\left(z + x\right) \cdot \color{blue}{\left(z - x\right)}\right)}{\left(z + x\right) \cdot t} \]
                    6. difference-of-squares-revN/A

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

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

                      \[\leadsto x + \frac{\color{blue}{\left(z \cdot z - x \cdot x\right) \cdot y}}{\left(z + x\right) \cdot t} \]
                    9. difference-of-squares-revN/A

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

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

                      \[\leadsto x + \frac{\left(\left(z + x\right) \cdot \color{blue}{\left(z - x\right)}\right) \cdot y}{\left(z + x\right) \cdot t} \]
                    12. lower-*.f6469.3

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

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

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

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

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

                    \[\leadsto \color{blue}{y \cdot \left(\frac{z}{t} - \frac{x}{t}\right)} \]
                  8. Step-by-step derivation
                    1. Applied rewrites76.1%

                      \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} \]
                  9. Recombined 3 regimes into one program.
                  10. Final simplification86.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -420000000000:\\ \;\;\;\;\frac{y}{t} \cdot \left(z - x\right)\\ \mathbf{elif}\;y \leq 2.44 \cdot 10^{-42}:\\ \;\;\;\;x + \frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z - x}{t} \cdot y\\ \end{array} \]
                  11. Add Preprocessing

                  Alternative 5: 54.0% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{-140} \lor \neg \left(y \leq 3.4 \cdot 10^{-91}\right):\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (or (<= y -7.6e-140) (not (<= y 3.4e-91))) (* (/ y t) z) x))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((y <= -7.6e-140) || !(y <= 3.4e-91)) {
                  		tmp = (y / t) * z;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y, z, t)
                  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) :: tmp
                      if ((y <= (-7.6d-140)) .or. (.not. (y <= 3.4d-91))) then
                          tmp = (y / t) * z
                      else
                          tmp = x
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((y <= -7.6e-140) || !(y <= 3.4e-91)) {
                  		tmp = (y / t) * z;
                  	} else {
                  		tmp = x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if (y <= -7.6e-140) or not (y <= 3.4e-91):
                  		tmp = (y / t) * z
                  	else:
                  		tmp = x
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if ((y <= -7.6e-140) || !(y <= 3.4e-91))
                  		tmp = Float64(Float64(y / t) * z);
                  	else
                  		tmp = x;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if ((y <= -7.6e-140) || ~((y <= 3.4e-91)))
                  		tmp = (y / t) * z;
                  	else
                  		tmp = x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.6e-140], N[Not[LessEqual[y, 3.4e-91]], $MachinePrecision]], N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision], x]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y \leq -7.6 \cdot 10^{-140} \lor \neg \left(y \leq 3.4 \cdot 10^{-91}\right):\\
                  \;\;\;\;\frac{y}{t} \cdot z\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if y < -7.59999999999999997e-140 or 3.40000000000000027e-91 < y

                    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                    6. Step-by-step derivation
                      1. Applied rewrites52.9%

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

                      if -7.59999999999999997e-140 < y < 3.40000000000000027e-91

                      1. Initial program 98.8%

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

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

                          \[\leadsto \color{blue}{x} \]
                      5. Recombined 2 regimes into one program.
                      6. Final simplification59.9%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{-140} \lor \neg \left(y \leq 3.4 \cdot 10^{-91}\right):\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 6: 52.7% accurate, 0.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{-140} \lor \neg \left(y \leq 3.4 \cdot 10^{-91}\right):\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (if (or (<= y -7.6e-140) (not (<= y 3.4e-91))) (* (/ z t) y) x))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if ((y <= -7.6e-140) || !(y <= 3.4e-91)) {
                      		tmp = (z / t) * y;
                      	} else {
                      		tmp = x;
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z, t)
                      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) :: tmp
                          if ((y <= (-7.6d-140)) .or. (.not. (y <= 3.4d-91))) then
                              tmp = (z / t) * y
                          else
                              tmp = x
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if ((y <= -7.6e-140) || !(y <= 3.4e-91)) {
                      		tmp = (z / t) * y;
                      	} else {
                      		tmp = x;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	tmp = 0
                      	if (y <= -7.6e-140) or not (y <= 3.4e-91):
                      		tmp = (z / t) * y
                      	else:
                      		tmp = x
                      	return tmp
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if ((y <= -7.6e-140) || !(y <= 3.4e-91))
                      		tmp = Float64(Float64(z / t) * y);
                      	else
                      		tmp = x;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	tmp = 0.0;
                      	if ((y <= -7.6e-140) || ~((y <= 3.4e-91)))
                      		tmp = (z / t) * y;
                      	else
                      		tmp = x;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := If[Or[LessEqual[y, -7.6e-140], N[Not[LessEqual[y, 3.4e-91]], $MachinePrecision]], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], x]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y \leq -7.6 \cdot 10^{-140} \lor \neg \left(y \leq 3.4 \cdot 10^{-91}\right):\\
                      \;\;\;\;\frac{z}{t} \cdot y\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y < -7.59999999999999997e-140 or 3.40000000000000027e-91 < y

                        1. Initial program 90.8%

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

                          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                        4. Step-by-step derivation
                          1. Applied rewrites49.9%

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

                          if -7.59999999999999997e-140 < y < 3.40000000000000027e-91

                          1. Initial program 98.8%

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

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

                              \[\leadsto \color{blue}{x} \]
                          5. Recombined 2 regimes into one program.
                          6. Final simplification57.9%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{-140} \lor \neg \left(y \leq 3.4 \cdot 10^{-91}\right):\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                          7. Add Preprocessing

                          Alternative 7: 97.4% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 8: 77.1% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{y}{t}, \color{blue}{z}, x\right) \]
                          6. Step-by-step derivation
                            1. Applied rewrites74.7%

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

                            Alternative 9: 38.6% accurate, 23.0× speedup?

                            \[\begin{array}{l} \\ x \end{array} \]
                            (FPCore (x y z t) :precision binary64 x)
                            double code(double x, double y, double z, double t) {
                            	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)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                code = x
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	return x;
                            }
                            
                            def code(x, y, z, t):
                            	return x
                            
                            function code(x, y, z, t)
                            	return x
                            end
                            
                            function tmp = code(x, y, z, t)
                            	tmp = x;
                            end
                            
                            code[x_, y_, z_, t_] := x
                            
                            \begin{array}{l}
                            
                            \\
                            x
                            \end{array}
                            
                            Derivation
                            1. Initial program 93.6%

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

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

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

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

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

                              Reproduce

                              ?
                              herbie shell --seed 2025026 
                              (FPCore (x y z t)
                                :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
                                :precision binary64
                              
                                :alt
                                (! :herbie-platform default (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
                              
                                (+ x (/ (* y (- z x)) t)))