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

Percentage Accurate: 92.9% → 97.7%
Time: 3.1s
Alternatives: 8
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 8 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.9% 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: 97.7% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1750000000000 \lor \neg \left(z \leq 4 \cdot 10^{-92}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, 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 -1750000000000.0) (not (<= z 4e-92)))
   (fma y (/ z t) x)
   (* (- 1.0 (/ y t)) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1750000000000.0) || !(z <= 4e-92)) {
		tmp = fma(y, (z / t), x);
	} else {
		tmp = (1.0 - (y / t)) * x;
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1750000000000.0) || !(z <= 4e-92))
		tmp = fma(y, Float64(z / t), x);
	else
		tmp = Float64(Float64(1.0 - Float64(y / t)) * x);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1750000000000.0], N[Not[LessEqual[z, 4e-92]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1750000000000 \lor \neg \left(z \leq 4 \cdot 10^{-92}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, 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 < -1.75e12 or 3.99999999999999995e-92 < z

    1. Initial program 89.9%

      \[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 rewrites82.9%

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

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

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

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

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

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

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

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

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

      if -1.75e12 < z < 3.99999999999999995e-92

      1. Initial program 92.7%

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

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

          \[\leadsto \left(1 + -1 \cdot \frac{y}{t}\right) \cdot \color{blue}{x} \]
        3. cancel-sign-subN/A

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

          \[\leadsto \left(1 - 1 \cdot \frac{y}{t}\right) \cdot x \]
        5. *-lft-identityN/A

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

          \[\leadsto \left(1 - \frac{y}{t}\right) \cdot x \]
        7. lower-/.f6489.5

          \[\leadsto \left(1 - \frac{y}{t}\right) \cdot x \]
      5. Applied rewrites89.5%

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

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

    Alternative 3: 83.4% accurate, 0.7× speedup?

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

      1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

        if -1.75e12 < z < 3.99999999999999995e-92

        1. Initial program 92.7%

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

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

            \[\leadsto \left(1 + -1 \cdot \frac{y}{t}\right) \cdot \color{blue}{x} \]
          3. cancel-sign-subN/A

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

            \[\leadsto \left(1 - 1 \cdot \frac{y}{t}\right) \cdot x \]
          5. *-lft-identityN/A

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

            \[\leadsto \left(1 - \frac{y}{t}\right) \cdot x \]
          7. lower-/.f6489.5

            \[\leadsto \left(1 - \frac{y}{t}\right) \cdot x \]
        5. Applied rewrites89.5%

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

        if 3.99999999999999995e-92 < z

        1. Initial program 91.9%

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

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

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

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

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

              \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
            5. lower-/.f6487.4

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

            \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
        5. Recombined 3 regimes into one program.
        6. Final simplification87.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1750000000000:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, x\right)\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-92}:\\ \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 4: 73.8% accurate, 0.7× speedup?

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

          1. Initial program 90.5%

            \[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 rewrites78.9%

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

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

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

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

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

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

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

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

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

            if -5.20000000000000007e-173 < t < 1.2000000000000001e-236

            1. Initial program 95.0%

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

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

                \[\leadsto \left(1 + -1 \cdot \frac{y}{t}\right) \cdot \color{blue}{x} \]
              3. cancel-sign-subN/A

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

                \[\leadsto \left(1 - 1 \cdot \frac{y}{t}\right) \cdot x \]
              5. *-lft-identityN/A

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

                \[\leadsto \left(1 - \frac{y}{t}\right) \cdot x \]
              7. lower-/.f6475.0

                \[\leadsto \left(1 - \frac{y}{t}\right) \cdot x \]
            5. Applied rewrites75.0%

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

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

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

                \[\leadsto \frac{-1 \cdot y}{t} \cdot x \]
              3. mul-1-negN/A

                \[\leadsto \frac{\mathsf{neg}\left(y\right)}{t} \cdot x \]
              4. lower-neg.f6475.0

                \[\leadsto \frac{-y}{t} \cdot x \]
            8. Applied rewrites75.0%

              \[\leadsto \frac{-y}{t} \cdot x \]
          5. Recombined 2 regimes into one program.
          6. Final simplification80.6%

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

          Alternative 5: 55.7% accurate, 0.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-85} \lor \neg \left(y \leq 20000000\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (or (<= y -1e-85) (not (<= y 20000000.0))) (* z (/ y t)) x))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if ((y <= -1e-85) || !(y <= 20000000.0)) {
          		tmp = z * (y / t);
          	} 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 <= (-1d-85)) .or. (.not. (y <= 20000000.0d0))) then
                  tmp = z * (y / t)
              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 <= -1e-85) || !(y <= 20000000.0)) {
          		tmp = z * (y / t);
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if (y <= -1e-85) or not (y <= 20000000.0):
          		tmp = z * (y / t)
          	else:
          		tmp = x
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if ((y <= -1e-85) || !(y <= 20000000.0))
          		tmp = Float64(z * Float64(y / t));
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if ((y <= -1e-85) || ~((y <= 20000000.0)))
          		tmp = z * (y / t);
          	else
          		tmp = x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e-85], N[Not[LessEqual[y, 20000000.0]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -1 \cdot 10^{-85} \lor \neg \left(y \leq 20000000\right):\\
          \;\;\;\;z \cdot \frac{y}{t}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -9.9999999999999998e-86 or 2e7 < y

            1. Initial program 85.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{z \cdot y}{t} \]
              2. associate-*r/N/A

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

                \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
              4. lift-/.f6457.8

                \[\leadsto z \cdot \frac{y}{\color{blue}{t}} \]
            7. Applied rewrites57.8%

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

            if -9.9999999999999998e-86 < y < 2e7

            1. Initial program 98.3%

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

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

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

            Alternative 6: 54.8% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.22 \cdot 10^{-18} \lor \neg \left(y \leq 20000000\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (or (<= y -1.22e-18) (not (<= y 20000000.0))) (* y (/ z t)) x))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if ((y <= -1.22e-18) || !(y <= 20000000.0)) {
            		tmp = y * (z / t);
            	} 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 <= (-1.22d-18)) .or. (.not. (y <= 20000000.0d0))) then
                    tmp = y * (z / t)
                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 <= -1.22e-18) || !(y <= 20000000.0)) {
            		tmp = y * (z / t);
            	} else {
            		tmp = x;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	tmp = 0
            	if (y <= -1.22e-18) or not (y <= 20000000.0):
            		tmp = y * (z / t)
            	else:
            		tmp = x
            	return tmp
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if ((y <= -1.22e-18) || !(y <= 20000000.0))
            		tmp = Float64(y * Float64(z / t));
            	else
            		tmp = x;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if ((y <= -1.22e-18) || ~((y <= 20000000.0)))
            		tmp = y * (z / t);
            	else
            		tmp = x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.22e-18], N[Not[LessEqual[y, 20000000.0]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -1.22 \cdot 10^{-18} \lor \neg \left(y \leq 20000000\right):\\
            \;\;\;\;y \cdot \frac{z}{t}\\
            
            \mathbf{else}:\\
            \;\;\;\;x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1.2200000000000001e-18 or 2e7 < y

              1. Initial program 84.2%

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

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

                  \[\leadsto \frac{z \cdot y}{t} \]
                3. lower-*.f6451.2

                  \[\leadsto \frac{z \cdot y}{t} \]
              5. Applied rewrites51.2%

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

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

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

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

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

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

                  \[\leadsto y \cdot \frac{z}{\color{blue}{t}} \]
              7. Applied rewrites57.6%

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

              if -1.2200000000000001e-18 < y < 2e7

              1. Initial program 98.5%

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

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

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

              Alternative 7: 73.4% accurate, 1.3× speedup?

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

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

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

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

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

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

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

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

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

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

                Alternative 8: 38.8% 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 91.1%

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

                    \[\leadsto \color{blue}{x} \]
                  2. Final simplification39.3%

                    \[\leadsto x \]
                  3. Add Preprocessing

                  Developer Target 1: 90.9% 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 2025064 
                  (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)))