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

Percentage Accurate: 93.2% → 97.6%
Time: 6.8s
Alternatives: 10
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);
}
real(8) function code(x, y, z, t)
    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 10 alternatives:

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

Initial Program: 93.2% 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);
}
real(8) function code(x, y, z, t)
    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.6% 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 94.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. *-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. Add Preprocessing

Alternative 2: 84.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.38 \cdot 10^{-34} \lor \neg \left(x \leq 7.1 \cdot 10^{-12}\right):\\ \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -1.38e-34) (not (<= x 7.1e-12)))
   (* (- 1.0 (/ y t)) x)
   (+ x (/ (* z y) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.38e-34) || !(x <= 7.1e-12)) {
		tmp = (1.0 - (y / t)) * x;
	} else {
		tmp = x + ((z * y) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x <= (-1.38d-34)) .or. (.not. (x <= 7.1d-12))) then
        tmp = (1.0d0 - (y / t)) * x
    else
        tmp = x + ((z * y) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.38e-34) || !(x <= 7.1e-12)) {
		tmp = (1.0 - (y / t)) * x;
	} else {
		tmp = x + ((z * y) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -1.38e-34) or not (x <= 7.1e-12):
		tmp = (1.0 - (y / t)) * x
	else:
		tmp = x + ((z * y) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -1.38e-34) || !(x <= 7.1e-12))
		tmp = Float64(Float64(1.0 - Float64(y / t)) * x);
	else
		tmp = Float64(x + Float64(Float64(z * y) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -1.38e-34) || ~((x <= 7.1e-12)))
		tmp = (1.0 - (y / t)) * x;
	else
		tmp = x + ((z * y) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.38e-34], N[Not[LessEqual[x, 7.1e-12]], $MachinePrecision]], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.38 \cdot 10^{-34} \lor \neg \left(x \leq 7.1 \cdot 10^{-12}\right):\\
\;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\

\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.37999999999999994e-34 or 7.1e-12 < x

    1. Initial program 89.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(1 - \frac{y}{t}\right)} \cdot x \]
      7. lower-/.f6487.2

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

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

    if -1.37999999999999994e-34 < x < 7.1e-12

    1. Initial program 98.4%

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

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

        \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
      2. lower-*.f6487.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.38 \cdot 10^{-34} \lor \neg \left(x \leq 7.1 \cdot 10^{-12}\right):\\ \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-63} \lor \neg \left(x \leq 4.7 \cdot 10^{-28}\right):\\ \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -8.2e-63) (not (<= x 4.7e-28)))
   (* (- 1.0 (/ y t)) x)
   (/ (* (- z x) y) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -8.2e-63) || !(x <= 4.7e-28)) {
		tmp = (1.0 - (y / t)) * x;
	} else {
		tmp = ((z - x) * y) / t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x <= (-8.2d-63)) .or. (.not. (x <= 4.7d-28))) then
        tmp = (1.0d0 - (y / t)) * x
    else
        tmp = ((z - x) * y) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -8.2e-63) || !(x <= 4.7e-28)) {
		tmp = (1.0 - (y / t)) * x;
	} else {
		tmp = ((z - x) * y) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -8.2e-63) or not (x <= 4.7e-28):
		tmp = (1.0 - (y / t)) * x
	else:
		tmp = ((z - x) * y) / t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -8.2e-63) || !(x <= 4.7e-28))
		tmp = Float64(Float64(1.0 - Float64(y / t)) * x);
	else
		tmp = Float64(Float64(Float64(z - x) * y) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -8.2e-63) || ~((x <= 4.7e-28)))
		tmp = (1.0 - (y / t)) * x;
	else
		tmp = ((z - x) * y) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.2e-63], N[Not[LessEqual[x, 4.7e-28]], $MachinePrecision]], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{-63} \lor \neg \left(x \leq 4.7 \cdot 10^{-28}\right):\\
\;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.1999999999999995e-63 or 4.6999999999999996e-28 < x

    1. Initial program 89.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 \color{blue}{\left(1 + -1 \cdot \frac{y}{t}\right) \cdot x} \]
      2. lower-*.f64N/A

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

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

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

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

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

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

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

    if -8.1999999999999995e-63 < x < 4.6999999999999996e-28

    1. Initial program 99.0%

      \[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. div-subN/A

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

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

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

        \[\leadsto \color{blue}{\frac{z - x}{t}} \cdot y \]
      5. lower--.f6469.9

        \[\leadsto \frac{\color{blue}{z - x}}{t} \cdot y \]
    5. Applied rewrites69.9%

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

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

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

    Alternative 4: 78.0% accurate, 0.7× speedup?

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

      1. Initial program 89.5%

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

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

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

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

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

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

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

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

      if -1e-61 < x < 5.40000000000000018e-15

      1. Initial program 99.1%

        \[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. div-subN/A

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

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

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

          \[\leadsto \color{blue}{\frac{z - x}{t}} \cdot y \]
        5. lower--.f6469.8

          \[\leadsto \frac{\color{blue}{z - x}}{t} \cdot y \]
      5. Applied rewrites69.8%

        \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification78.0%

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

    Alternative 5: 84.8% accurate, 0.7× speedup?

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

      1. Initial program 92.9%

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(-1 \cdot x\right)}}{t} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)}}{t} \]
        2. lower-neg.f6480.9

          \[\leadsto x + \frac{y \cdot \color{blue}{\left(-x\right)}}{t} \]
      5. Applied rewrites80.9%

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

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

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

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

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

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

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

          \[\leadsto \left(-x\right) \cdot \color{blue}{\frac{y}{t}} + x \]
        8. lower-fma.f6488.0

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

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

      if -1.37999999999999994e-34 < x < 7.1e-12

      1. Initial program 98.4%

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

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

          \[\leadsto x + \frac{\color{blue}{z \cdot y}}{t} \]
        2. lower-*.f6487.8

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

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

      if 7.1e-12 < x

      1. Initial program 85.8%

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

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

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

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

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

          \[\leadsto \color{blue}{\left(1 - \frac{y}{t}\right)} \cdot x \]
        7. lower-/.f6486.2

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

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

    Alternative 6: 74.3% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+88}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+127}:\\ \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (if (<= z -3.5e+88)
       (* z (/ y t))
       (if (<= z 4.1e+127) (* (- 1.0 (/ y t)) x) (/ (* z y) t))))
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -3.5e+88) {
    		tmp = z * (y / t);
    	} else if (z <= 4.1e+127) {
    		tmp = (1.0 - (y / t)) * x;
    	} else {
    		tmp = (z * y) / t;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: tmp
        if (z <= (-3.5d+88)) then
            tmp = z * (y / t)
        else if (z <= 4.1d+127) then
            tmp = (1.0d0 - (y / t)) * x
        else
            tmp = (z * y) / t
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (z <= -3.5e+88) {
    		tmp = z * (y / t);
    	} else if (z <= 4.1e+127) {
    		tmp = (1.0 - (y / t)) * x;
    	} else {
    		tmp = (z * y) / t;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	tmp = 0
    	if z <= -3.5e+88:
    		tmp = z * (y / t)
    	elif z <= 4.1e+127:
    		tmp = (1.0 - (y / t)) * x
    	else:
    		tmp = (z * y) / t
    	return tmp
    
    function code(x, y, z, t)
    	tmp = 0.0
    	if (z <= -3.5e+88)
    		tmp = Float64(z * Float64(y / t));
    	elseif (z <= 4.1e+127)
    		tmp = Float64(Float64(1.0 - Float64(y / t)) * x);
    	else
    		tmp = Float64(Float64(z * y) / t);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (z <= -3.5e+88)
    		tmp = z * (y / t);
    	elseif (z <= 4.1e+127)
    		tmp = (1.0 - (y / t)) * x;
    	else
    		tmp = (z * y) / t;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := If[LessEqual[z, -3.5e+88], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+127], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -3.5 \cdot 10^{+88}:\\
    \;\;\;\;z \cdot \frac{y}{t}\\
    
    \mathbf{elif}\;z \leq 4.1 \cdot 10^{+127}:\\
    \;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{z \cdot y}{t}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -3.4999999999999998e88

      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 \color{blue}{\frac{y \cdot z}{t}} \]
      4. Step-by-step derivation
        1. associate-/l*N/A

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

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

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

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

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

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

        if -3.4999999999999998e88 < z < 4.09999999999999983e127

        1. Initial program 94.6%

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

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

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

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

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

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

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

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

        if 4.09999999999999983e127 < z

        1. Initial program 94.6%

          \[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. associate-/l*N/A

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

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

            \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
          4. lower-/.f6470.9

            \[\leadsto \color{blue}{\frac{z}{t}} \cdot y \]
        5. Applied rewrites70.9%

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

            \[\leadsto \frac{z \cdot y}{\color{blue}{t}} \]
        7. Recombined 3 regimes into one program.
        8. Add Preprocessing

        Alternative 7: 49.3% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{-73} \lor \neg \left(z \leq 7.2 \cdot 10^{-76}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-x\right) \cdot y}{t}\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (or (<= z -2.65e-73) (not (<= z 7.2e-76)))
           (* z (/ y t))
           (/ (* (- x) y) t)))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if ((z <= -2.65e-73) || !(z <= 7.2e-76)) {
        		tmp = z * (y / t);
        	} else {
        		tmp = (-x * y) / t;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z, t)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: tmp
            if ((z <= (-2.65d-73)) .or. (.not. (z <= 7.2d-76))) then
                tmp = z * (y / t)
            else
                tmp = (-x * y) / t
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double tmp;
        	if ((z <= -2.65e-73) || !(z <= 7.2e-76)) {
        		tmp = z * (y / t);
        	} else {
        		tmp = (-x * y) / t;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	tmp = 0
        	if (z <= -2.65e-73) or not (z <= 7.2e-76):
        		tmp = z * (y / t)
        	else:
        		tmp = (-x * y) / t
        	return tmp
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if ((z <= -2.65e-73) || !(z <= 7.2e-76))
        		tmp = Float64(z * Float64(y / t));
        	else
        		tmp = Float64(Float64(Float64(-x) * y) / t);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if ((z <= -2.65e-73) || ~((z <= 7.2e-76)))
        		tmp = z * (y / t);
        	else
        		tmp = (-x * y) / t;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.65e-73], N[Not[LessEqual[z, 7.2e-76]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(N[((-x) * y), $MachinePrecision] / t), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -2.65 \cdot 10^{-73} \lor \neg \left(z \leq 7.2 \cdot 10^{-76}\right):\\
        \;\;\;\;z \cdot \frac{y}{t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\left(-x\right) \cdot y}{t}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -2.64999999999999986e-73 or 7.2000000000000001e-76 < z

          1. Initial program 93.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. associate-/l*N/A

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

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

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

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

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

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

            if -2.64999999999999986e-73 < z < 7.2000000000000001e-76

            1. Initial program 96.0%

              \[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. div-subN/A

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

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

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

                \[\leadsto \color{blue}{\frac{z - x}{t}} \cdot y \]
              5. lower--.f6444.9

                \[\leadsto \frac{\color{blue}{z - x}}{t} \cdot y \]
            5. Applied rewrites44.9%

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

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

                \[\leadsto \frac{\left(-1 \cdot x\right) \cdot y}{t} \]
              3. Step-by-step derivation
                1. Applied rewrites37.7%

                  \[\leadsto \frac{\left(-x\right) \cdot y}{t} \]
              4. Recombined 2 regimes into one program.
              5. Final simplification50.9%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{-73} \lor \neg \left(z \leq 7.2 \cdot 10^{-76}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-x\right) \cdot y}{t}\\ \end{array} \]
              6. Add Preprocessing

              Alternative 8: 48.7% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{-73} \lor \neg \left(z \leq 2200000000000\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{t} \cdot y\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (or (<= z -2.65e-73) (not (<= z 2200000000000.0)))
                 (* z (/ y t))
                 (* (/ (- x) t) y)))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((z <= -2.65e-73) || !(z <= 2200000000000.0)) {
              		tmp = z * (y / t);
              	} else {
              		tmp = (-x / t) * y;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: tmp
                  if ((z <= (-2.65d-73)) .or. (.not. (z <= 2200000000000.0d0))) then
                      tmp = z * (y / t)
                  else
                      tmp = (-x / t) * y
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double tmp;
              	if ((z <= -2.65e-73) || !(z <= 2200000000000.0)) {
              		tmp = z * (y / t);
              	} else {
              		tmp = (-x / t) * y;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	tmp = 0
              	if (z <= -2.65e-73) or not (z <= 2200000000000.0):
              		tmp = z * (y / t)
              	else:
              		tmp = (-x / t) * y
              	return tmp
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if ((z <= -2.65e-73) || !(z <= 2200000000000.0))
              		tmp = Float64(z * Float64(y / t));
              	else
              		tmp = Float64(Float64(Float64(-x) / t) * y);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	tmp = 0.0;
              	if ((z <= -2.65e-73) || ~((z <= 2200000000000.0)))
              		tmp = z * (y / t);
              	else
              		tmp = (-x / t) * y;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.65e-73], N[Not[LessEqual[z, 2200000000000.0]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / t), $MachinePrecision] * y), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;z \leq -2.65 \cdot 10^{-73} \lor \neg \left(z \leq 2200000000000\right):\\
              \;\;\;\;z \cdot \frac{y}{t}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{-x}{t} \cdot y\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -2.64999999999999986e-73 or 2.2e12 < z

                1. Initial program 93.1%

                  \[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. associate-/l*N/A

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

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

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

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

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

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

                  if -2.64999999999999986e-73 < z < 2.2e12

                  1. Initial program 95.4%

                    \[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. div-subN/A

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

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

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

                      \[\leadsto \color{blue}{\frac{z - x}{t}} \cdot y \]
                    5. lower--.f6450.7

                      \[\leadsto \frac{\color{blue}{z - x}}{t} \cdot y \]
                  5. Applied rewrites50.7%

                    \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} \]
                  6. Taylor expanded in x around inf

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

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

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

                  Alternative 9: 49.2% accurate, 0.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{-73} \lor \neg \left(z \leq 2200000000000\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(-x\right) \cdot \frac{y}{t}\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (or (<= z -2.65e-73) (not (<= z 2200000000000.0)))
                     (* z (/ y t))
                     (* (- x) (/ y t))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z <= -2.65e-73) || !(z <= 2200000000000.0)) {
                  		tmp = z * (y / t);
                  	} else {
                  		tmp = -x * (y / t);
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z, t)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8) :: tmp
                      if ((z <= (-2.65d-73)) .or. (.not. (z <= 2200000000000.0d0))) then
                          tmp = z * (y / t)
                      else
                          tmp = -x * (y / t)
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((z <= -2.65e-73) || !(z <= 2200000000000.0)) {
                  		tmp = z * (y / t);
                  	} else {
                  		tmp = -x * (y / t);
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if (z <= -2.65e-73) or not (z <= 2200000000000.0):
                  		tmp = z * (y / t)
                  	else:
                  		tmp = -x * (y / t)
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if ((z <= -2.65e-73) || !(z <= 2200000000000.0))
                  		tmp = Float64(z * Float64(y / t));
                  	else
                  		tmp = Float64(Float64(-x) * Float64(y / t));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if ((z <= -2.65e-73) || ~((z <= 2200000000000.0)))
                  		tmp = z * (y / t);
                  	else
                  		tmp = -x * (y / t);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.65e-73], N[Not[LessEqual[z, 2200000000000.0]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(y / t), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -2.65 \cdot 10^{-73} \lor \neg \left(z \leq 2200000000000\right):\\
                  \;\;\;\;z \cdot \frac{y}{t}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(-x\right) \cdot \frac{y}{t}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -2.64999999999999986e-73 or 2.2e12 < z

                    1. Initial program 93.1%

                      \[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. associate-/l*N/A

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

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

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

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

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

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

                      if -2.64999999999999986e-73 < z < 2.2e12

                      1. Initial program 95.4%

                        \[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. div-subN/A

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

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

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

                          \[\leadsto \color{blue}{\frac{z - x}{t}} \cdot y \]
                        5. lower--.f6450.7

                          \[\leadsto \frac{\color{blue}{z - x}}{t} \cdot y \]
                      5. Applied rewrites50.7%

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

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

                          \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot y}{t}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites37.1%

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

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

                        Alternative 10: 40.3% accurate, 1.4× speedup?

                        \[\begin{array}{l} \\ z \cdot \frac{y}{t} \end{array} \]
                        (FPCore (x y z t) :precision binary64 (* z (/ y t)))
                        double code(double x, double y, double z, double t) {
                        	return z * (y / t);
                        }
                        
                        real(8) function code(x, y, z, t)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            code = z * (y / t)
                        end function
                        
                        public static double code(double x, double y, double z, double t) {
                        	return z * (y / t);
                        }
                        
                        def code(x, y, z, t):
                        	return z * (y / t)
                        
                        function code(x, y, z, t)
                        	return Float64(z * Float64(y / t))
                        end
                        
                        function tmp = code(x, y, z, t)
                        	tmp = z * (y / t);
                        end
                        
                        code[x_, y_, z_, t_] := N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        z \cdot \frac{y}{t}
                        \end{array}
                        
                        Derivation
                        1. Initial program 94.3%

                          \[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. associate-/l*N/A

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

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

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

                            \[\leadsto \color{blue}{\frac{z}{t}} \cdot y \]
                        5. Applied rewrites40.0%

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

                            \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
                          2. Add Preprocessing

                          Developer Target 1: 90.6% 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)));
                          }
                          
                          real(8) function code(x, y, z, t)
                              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 2024320 
                          (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)))