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

Percentage Accurate: 93.2% → 98.0%
Time: 9.4s
Alternatives: 12
Speedup: 1.0×

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 12 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: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(z - x\right) \cdot \frac{y}{t} \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
	return x + ((z - x) * (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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((z - x) * (y / t));
}
def code(x, y, z, t):
	return x + ((z - x) * (y / t))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(z - x) * Float64(y / t)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((z - x) * (y / t));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(z - x\right) \cdot \frac{y}{t}
\end{array}
Derivation
  1. Initial program 92.4%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Step-by-step derivation
    1. +-commutative92.4%

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

      \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
    3. fma-define96.3%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - x}{t}, x\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-undefine96.3%

      \[\leadsto \color{blue}{y \cdot \frac{z - x}{t} + x} \]
    2. associate-/l*92.4%

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} + x \]
    3. *-commutative92.4%

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

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

    \[\leadsto \color{blue}{\left(z - x\right) \cdot \frac{y}{t} + x} \]
  7. Final simplification96.6%

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

Alternative 2: 49.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 125 \lor \neg \left(t \leq 1.3 \cdot 10^{+72}\right) \land t \leq 7.6 \cdot 10^{+189}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -1.6e-118)
   x
   (if (or (<= t 125.0) (and (not (<= t 1.3e+72)) (<= t 7.6e+189)))
     (* y (/ z t))
     x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.6e-118) {
		tmp = x;
	} else if ((t <= 125.0) || (!(t <= 1.3e+72) && (t <= 7.6e+189))) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	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 (t <= (-1.6d-118)) then
        tmp = x
    else if ((t <= 125.0d0) .or. (.not. (t <= 1.3d+72)) .and. (t <= 7.6d+189)) 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 (t <= -1.6e-118) {
		tmp = x;
	} else if ((t <= 125.0) || (!(t <= 1.3e+72) && (t <= 7.6e+189))) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -1.6e-118:
		tmp = x
	elif (t <= 125.0) or (not (t <= 1.3e+72) and (t <= 7.6e+189)):
		tmp = y * (z / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1.6e-118)
		tmp = x;
	elseif ((t <= 125.0) || (!(t <= 1.3e+72) && (t <= 7.6e+189)))
		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 (t <= -1.6e-118)
		tmp = x;
	elseif ((t <= 125.0) || (~((t <= 1.3e+72)) && (t <= 7.6e+189)))
		tmp = y * (z / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.6e-118], x, If[Or[LessEqual[t, 125.0], And[N[Not[LessEqual[t, 1.3e+72]], $MachinePrecision], LessEqual[t, 7.6e+189]]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-118}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 125 \lor \neg \left(t \leq 1.3 \cdot 10^{+72}\right) \land t \leq 7.6 \cdot 10^{+189}:\\
\;\;\;\;y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.60000000000000002e-118 or 125 < t < 1.29999999999999991e72 or 7.5999999999999997e189 < t

    1. Initial program 87.1%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative87.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define99.0%

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

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

      \[\leadsto \color{blue}{x} \]

    if -1.60000000000000002e-118 < t < 125 or 1.29999999999999991e72 < t < 7.5999999999999997e189

    1. Initial program 97.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative97.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define94.0%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-/l*51.4%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    8. Simplified51.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 125 \lor \neg \left(t \leq 1.3 \cdot 10^{+72}\right) \land t \leq 7.6 \cdot 10^{+189}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 49.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.7 \cdot 10^{-120}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 220:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+72}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+190}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -4.7e-120)
   x
   (if (<= t 220.0)
     (/ y (/ t z))
     (if (<= t 2.4e+72) x (if (<= t 2.6e+190) (* y (/ z t)) x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4.7e-120) {
		tmp = x;
	} else if (t <= 220.0) {
		tmp = y / (t / z);
	} else if (t <= 2.4e+72) {
		tmp = x;
	} else if (t <= 2.6e+190) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	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 (t <= (-4.7d-120)) then
        tmp = x
    else if (t <= 220.0d0) then
        tmp = y / (t / z)
    else if (t <= 2.4d+72) then
        tmp = x
    else if (t <= 2.6d+190) 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 (t <= -4.7e-120) {
		tmp = x;
	} else if (t <= 220.0) {
		tmp = y / (t / z);
	} else if (t <= 2.4e+72) {
		tmp = x;
	} else if (t <= 2.6e+190) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -4.7e-120:
		tmp = x
	elif t <= 220.0:
		tmp = y / (t / z)
	elif t <= 2.4e+72:
		tmp = x
	elif t <= 2.6e+190:
		tmp = y * (z / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -4.7e-120)
		tmp = x;
	elseif (t <= 220.0)
		tmp = Float64(y / Float64(t / z));
	elseif (t <= 2.4e+72)
		tmp = x;
	elseif (t <= 2.6e+190)
		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 (t <= -4.7e-120)
		tmp = x;
	elseif (t <= 220.0)
		tmp = y / (t / z);
	elseif (t <= 2.4e+72)
		tmp = x;
	elseif (t <= 2.6e+190)
		tmp = y * (z / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.7e-120], x, If[LessEqual[t, 220.0], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+72], x, If[LessEqual[t, 2.6e+190], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.7 \cdot 10^{-120}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 220:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{+72}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+190}:\\
\;\;\;\;y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.70000000000000016e-120 or 220 < t < 2.4000000000000001e72 or 2.60000000000000011e190 < t

    1. Initial program 87.1%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative87.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define99.0%

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

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

      \[\leadsto \color{blue}{x} \]

    if -4.70000000000000016e-120 < t < 220

    1. Initial program 98.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative98.2%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define93.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-/l*50.6%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    8. Simplified50.6%

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      2. un-div-inv50.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    10. Applied egg-rr50.8%

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

    if 2.4000000000000001e72 < t < 2.60000000000000011e190

    1. Initial program 87.8%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative87.8%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define95.8%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-/l*57.5%

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

      \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.7 \cdot 10^{-120}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 220:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+72}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+190}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 49.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot y}{t}\\ \mathbf{if}\;z \leq -2.35 \cdot 10^{-22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-295}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+51}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* z y) t)))
   (if (<= z -2.35e-22)
     t_1
     (if (<= z 4.8e-295) x (if (<= z 6.8e+51) (* (/ y t) (- x)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * y) / t;
	double tmp;
	if (z <= -2.35e-22) {
		tmp = t_1;
	} else if (z <= 4.8e-295) {
		tmp = x;
	} else if (z <= 6.8e+51) {
		tmp = (y / t) * -x;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = (z * y) / t
    if (z <= (-2.35d-22)) then
        tmp = t_1
    else if (z <= 4.8d-295) then
        tmp = x
    else if (z <= 6.8d+51) then
        tmp = (y / t) * -x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z * y) / t;
	double tmp;
	if (z <= -2.35e-22) {
		tmp = t_1;
	} else if (z <= 4.8e-295) {
		tmp = x;
	} else if (z <= 6.8e+51) {
		tmp = (y / t) * -x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z * y) / t
	tmp = 0
	if z <= -2.35e-22:
		tmp = t_1
	elif z <= 4.8e-295:
		tmp = x
	elif z <= 6.8e+51:
		tmp = (y / t) * -x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z * y) / t)
	tmp = 0.0
	if (z <= -2.35e-22)
		tmp = t_1;
	elseif (z <= 4.8e-295)
		tmp = x;
	elseif (z <= 6.8e+51)
		tmp = Float64(Float64(y / t) * Float64(-x));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z * y) / t;
	tmp = 0.0;
	if (z <= -2.35e-22)
		tmp = t_1;
	elseif (z <= 4.8e-295)
		tmp = x;
	elseif (z <= 6.8e+51)
		tmp = (y / t) * -x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -2.35e-22], t$95$1, If[LessEqual[z, 4.8e-295], x, If[LessEqual[z, 6.8e+51], N[(N[(y / t), $MachinePrecision] * (-x)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t}\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-295}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{+51}:\\
\;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3500000000000001e-22 or 6.79999999999999969e51 < z

    1. Initial program 93.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative93.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define95.6%

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

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

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

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

    if -2.3500000000000001e-22 < z < 4.7999999999999996e-295

    1. Initial program 88.4%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative88.4%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define96.2%

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

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

      \[\leadsto \color{blue}{x} \]

    if 4.7999999999999996e-295 < z < 6.79999999999999969e51

    1. Initial program 95.1%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative95.1%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot y}{t}} \]
    7. Step-by-step derivation
      1. mul-1-neg50.8%

        \[\leadsto \color{blue}{-\frac{x \cdot y}{t}} \]
      2. associate-/l*50.7%

        \[\leadsto -\color{blue}{x \cdot \frac{y}{t}} \]
      3. distribute-rgt-neg-in50.7%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      4. mul-1-neg50.7%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      5. associate-*r/50.7%

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot y}{t}} \]
      6. mul-1-neg50.7%

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{t} \]
    8. Simplified50.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{-22}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-295}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+51}:\\ \;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 48.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z \cdot y}{t}\\ \mathbf{if}\;z \leq -2.25 \cdot 10^{-24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-294}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+43}:\\ \;\;\;\;y \cdot \frac{-x}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (* z y) t)))
   (if (<= z -2.25e-24)
     t_1
     (if (<= z 1.02e-294) x (if (<= z 9e+43) (* y (/ (- x) t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (z * y) / t;
	double tmp;
	if (z <= -2.25e-24) {
		tmp = t_1;
	} else if (z <= 1.02e-294) {
		tmp = x;
	} else if (z <= 9e+43) {
		tmp = y * (-x / t);
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = (z * y) / t
    if (z <= (-2.25d-24)) then
        tmp = t_1
    else if (z <= 1.02d-294) then
        tmp = x
    else if (z <= 9d+43) then
        tmp = y * (-x / t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z * y) / t;
	double tmp;
	if (z <= -2.25e-24) {
		tmp = t_1;
	} else if (z <= 1.02e-294) {
		tmp = x;
	} else if (z <= 9e+43) {
		tmp = y * (-x / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z * y) / t
	tmp = 0
	if z <= -2.25e-24:
		tmp = t_1
	elif z <= 1.02e-294:
		tmp = x
	elif z <= 9e+43:
		tmp = y * (-x / t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z * y) / t)
	tmp = 0.0
	if (z <= -2.25e-24)
		tmp = t_1;
	elseif (z <= 1.02e-294)
		tmp = x;
	elseif (z <= 9e+43)
		tmp = Float64(y * Float64(Float64(-x) / t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z * y) / t;
	tmp = 0.0;
	if (z <= -2.25e-24)
		tmp = t_1;
	elseif (z <= 1.02e-294)
		tmp = x;
	elseif (z <= 9e+43)
		tmp = y * (-x / t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -2.25e-24], t$95$1, If[LessEqual[z, 1.02e-294], x, If[LessEqual[z, 9e+43], N[(y * N[((-x) / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z \cdot y}{t}\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.02 \cdot 10^{-294}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9 \cdot 10^{+43}:\\
\;\;\;\;y \cdot \frac{-x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.2499999999999999e-24 or 9e43 < z

    1. Initial program 93.2%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative93.2%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define94.9%

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

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

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

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

    if -2.2499999999999999e-24 < z < 1.01999999999999998e-294

    1. Initial program 88.4%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative88.4%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define96.2%

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

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

      \[\leadsto \color{blue}{x} \]

    if 1.01999999999999998e-294 < z < 9e43

    1. Initial program 94.9%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative94.9%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define98.5%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
    6. Step-by-step derivation
      1. associate-/l*64.8%

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} \]
      2. *-commutative64.8%

        \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} \]
    7. Applied egg-rr64.8%

      \[\leadsto \color{blue}{\frac{z - x}{t} \cdot y} \]
    8. Taylor expanded in z around 0 53.5%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{t}\right)} \cdot y \]
    9. Step-by-step derivation
      1. neg-mul-153.5%

        \[\leadsto \color{blue}{\left(-\frac{x}{t}\right)} \cdot y \]
      2. distribute-neg-frac253.5%

        \[\leadsto \color{blue}{\frac{x}{-t}} \cdot y \]
    10. Simplified53.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{-24}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-294}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+43}:\\ \;\;\;\;y \cdot \frac{-x}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{+62} \lor \neg \left(z \leq 2.2 \cdot 10^{+58}\right):\\
\;\;\;\;\frac{z \cdot y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.09999999999999998e62 or 2.2000000000000001e58 < z

    1. Initial program 91.3%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative91.3%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define94.5%

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

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

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

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

    if -5.09999999999999998e62 < z < 2.2000000000000001e58

    1. Initial program 93.1%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative93.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define97.2%

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. *-rgt-identity80.4%

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg80.4%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in84.4%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      5. mul-1-neg84.4%

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in84.4%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
      7. mul-1-neg84.4%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{y}{t}\right)}\right) \]
      8. unsub-neg84.4%

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

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

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

Alternative 7: 77.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-16} \lor \neg \left(x \leq 4.3 \cdot 10^{-93}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.2500000000000001e-16 or 4.29999999999999963e-93 < x

    1. Initial program 90.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative90.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define96.2%

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. *-rgt-identity82.0%

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg82.0%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in88.8%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      5. mul-1-neg88.8%

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in88.8%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
      7. mul-1-neg88.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{y}{t}\right)}\right) \]
      8. unsub-neg88.8%

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

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

    if -1.2500000000000001e-16 < x < 4.29999999999999963e-93

    1. Initial program 96.1%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative96.1%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(z - x\right)}{t}} \]
    6. Step-by-step derivation
      1. associate-/l*70.7%

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} \]
      2. *-commutative70.7%

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

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

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

Alternative 8: 84.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-20} \lor \neg \left(x \leq 1.8 \cdot 10^{-43}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.8000000000000003e-20 or 1.7999999999999999e-43 < x

    1. Initial program 89.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative89.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define96.5%

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. *-rgt-identity83.4%

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg83.4%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in91.6%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      5. mul-1-neg91.6%

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in91.6%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
      7. mul-1-neg91.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{y}{t}\right)}\right) \]
      8. unsub-neg91.6%

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

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

    if -9.8000000000000003e-20 < x < 1.7999999999999999e-43

    1. Initial program 96.5%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified82.4%

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

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

Alternative 9: 85.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+23} \lor \neg \left(x \leq 6 \cdot 10^{-41}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.7999999999999999e23 or 5.99999999999999978e-41 < x

    1. Initial program 88.5%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative88.5%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define97.1%

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{t}} \]
    6. Step-by-step derivation
      1. *-rgt-identity84.1%

        \[\leadsto \color{blue}{x \cdot 1} + -1 \cdot \frac{x \cdot y}{t} \]
      2. mul-1-neg84.1%

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

        \[\leadsto x \cdot 1 + \left(-\color{blue}{x \cdot \frac{y}{t}}\right) \]
      4. distribute-rgt-neg-in92.6%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-\frac{y}{t}\right)} \]
      5. mul-1-neg92.6%

        \[\leadsto x \cdot 1 + x \cdot \color{blue}{\left(-1 \cdot \frac{y}{t}\right)} \]
      6. distribute-lft-in92.6%

        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \frac{y}{t}\right)} \]
      7. mul-1-neg92.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{y}{t}\right)}\right) \]
      8. unsub-neg92.6%

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

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

    if -1.7999999999999999e23 < x < 5.99999999999999978e-41

    1. Initial program 96.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified81.1%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Step-by-step derivation
      1. clear-num52.8%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      2. un-div-inv53.1%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    7. Applied egg-rr80.9%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Step-by-step derivation
      1. associate-/r/83.5%

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

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

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

Alternative 10: 52.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{-33} \lor \neg \left(z \leq 2.65 \cdot 10^{+54}\right):\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -2.05e-33) (not (<= z 2.65e+54))) (/ (* z y) t) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2.05e-33) || !(z <= 2.65e+54)) {
		tmp = (z * y) / t;
	} else {
		tmp = x;
	}
	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.05d-33)) .or. (.not. (z <= 2.65d+54))) 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 ((z <= -2.05e-33) || !(z <= 2.65e+54)) {
		tmp = (z * y) / t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -2.05e-33) or not (z <= 2.65e+54):
		tmp = (z * y) / t
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -2.05e-33) || !(z <= 2.65e+54))
		tmp = Float64(Float64(z * y) / t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -2.05e-33) || ~((z <= 2.65e+54)))
		tmp = (z * y) / t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.05e-33], N[Not[LessEqual[z, 2.65e+54]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-33} \lor \neg \left(z \leq 2.65 \cdot 10^{+54}\right):\\
\;\;\;\;\frac{z \cdot y}{t}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.05e-33 or 2.65000000000000009e54 < z

    1. Initial program 93.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative93.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define95.6%

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

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

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

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

    if -2.05e-33 < z < 2.65000000000000009e54

    1. Initial program 92.0%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Step-by-step derivation
      1. +-commutative92.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
      3. fma-define96.8%

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.3%

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

Alternative 11: 92.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - x}{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(y * Float64(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[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - x}{t}
\end{array}
Derivation
  1. Initial program 92.4%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/l*61.5%

      \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} \]
    2. *-commutative61.5%

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

    \[\leadsto x + \color{blue}{\frac{z - x}{t} \cdot y} \]
  5. Final simplification96.3%

    \[\leadsto x + y \cdot \frac{z - x}{t} \]
  6. Add Preprocessing

Alternative 12: 39.1% accurate, 9.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;
}
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
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 92.4%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Step-by-step derivation
    1. +-commutative92.4%

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

      \[\leadsto \color{blue}{y \cdot \frac{z - x}{t}} + x \]
    3. fma-define96.3%

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification37.5%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 91.0% 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 2024053 
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
  :precision binary64

  :alt
  (- x (+ (* x (/ y t)) (* (- z) (/ y t))))

  (+ x (/ (* y (- z x)) t)))