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

Percentage Accurate: 93.3% → 97.8%
Time: 8.1s
Alternatives: 13
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 13 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.3% 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.8% 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 94.8%

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

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

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

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

Alternative 2: 54.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{-y}{t}\\ t_2 := \frac{z}{\frac{t}{y}}\\ \mathbf{if}\;t \leq -2.75 \cdot 10^{+84}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -4.7 \cdot 10^{-150}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -3.6 \cdot 10^{-231}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{-304}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+64}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (- y) t))) (t_2 (/ z (/ t y))))
   (if (<= t -2.75e+84)
     x
     (if (<= t -4.7e-150)
       t_2
       (if (<= t -3.6e-231)
         t_1
         (if (<= t 4.2e-304)
           t_2
           (if (<= t 1.45e-272) t_1 (if (<= t 1.05e+64) t_2 x))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (-y / t);
	double t_2 = z / (t / y);
	double tmp;
	if (t <= -2.75e+84) {
		tmp = x;
	} else if (t <= -4.7e-150) {
		tmp = t_2;
	} else if (t <= -3.6e-231) {
		tmp = t_1;
	} else if (t <= 4.2e-304) {
		tmp = t_2;
	} else if (t <= 1.45e-272) {
		tmp = t_1;
	} else if (t <= 1.05e+64) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (-y / t)
    t_2 = z / (t / y)
    if (t <= (-2.75d+84)) then
        tmp = x
    else if (t <= (-4.7d-150)) then
        tmp = t_2
    else if (t <= (-3.6d-231)) then
        tmp = t_1
    else if (t <= 4.2d-304) then
        tmp = t_2
    else if (t <= 1.45d-272) then
        tmp = t_1
    else if (t <= 1.05d+64) then
        tmp = t_2
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (-y / t);
	double t_2 = z / (t / y);
	double tmp;
	if (t <= -2.75e+84) {
		tmp = x;
	} else if (t <= -4.7e-150) {
		tmp = t_2;
	} else if (t <= -3.6e-231) {
		tmp = t_1;
	} else if (t <= 4.2e-304) {
		tmp = t_2;
	} else if (t <= 1.45e-272) {
		tmp = t_1;
	} else if (t <= 1.05e+64) {
		tmp = t_2;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (-y / t)
	t_2 = z / (t / y)
	tmp = 0
	if t <= -2.75e+84:
		tmp = x
	elif t <= -4.7e-150:
		tmp = t_2
	elif t <= -3.6e-231:
		tmp = t_1
	elif t <= 4.2e-304:
		tmp = t_2
	elif t <= 1.45e-272:
		tmp = t_1
	elif t <= 1.05e+64:
		tmp = t_2
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(-y) / t))
	t_2 = Float64(z / Float64(t / y))
	tmp = 0.0
	if (t <= -2.75e+84)
		tmp = x;
	elseif (t <= -4.7e-150)
		tmp = t_2;
	elseif (t <= -3.6e-231)
		tmp = t_1;
	elseif (t <= 4.2e-304)
		tmp = t_2;
	elseif (t <= 1.45e-272)
		tmp = t_1;
	elseif (t <= 1.05e+64)
		tmp = t_2;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (-y / t);
	t_2 = z / (t / y);
	tmp = 0.0;
	if (t <= -2.75e+84)
		tmp = x;
	elseif (t <= -4.7e-150)
		tmp = t_2;
	elseif (t <= -3.6e-231)
		tmp = t_1;
	elseif (t <= 4.2e-304)
		tmp = t_2;
	elseif (t <= 1.45e-272)
		tmp = t_1;
	elseif (t <= 1.05e+64)
		tmp = t_2;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[((-y) / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.75e+84], x, If[LessEqual[t, -4.7e-150], t$95$2, If[LessEqual[t, -3.6e-231], t$95$1, If[LessEqual[t, 4.2e-304], t$95$2, If[LessEqual[t, 1.45e-272], t$95$1, If[LessEqual[t, 1.05e+64], t$95$2, x]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{-y}{t}\\
t_2 := \frac{z}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -2.75 \cdot 10^{+84}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -4.7 \cdot 10^{-150}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -3.6 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 4.2 \cdot 10^{-304}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 1.45 \cdot 10^{-272}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.05 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.7500000000000002e84 or 1.05e64 < t

    1. Initial program 90.7%

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

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

    if -2.7500000000000002e84 < t < -4.6999999999999999e-150 or -3.59999999999999973e-231 < t < 4.20000000000000016e-304 or 1.44999999999999997e-272 < t < 1.05e64

    1. Initial program 97.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative70.0%

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

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/73.0%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Simplified59.8%

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

    if -4.6999999999999999e-150 < t < -3.59999999999999973e-231 or 4.20000000000000016e-304 < t < 1.44999999999999997e-272

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{t} \]
    6. Simplified73.9%

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

Alternative 3: 75.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+85} \lor \neg \left(t \leq 3.1 \cdot 10^{-52} \lor \neg \left(t \leq 1.15 \cdot 10^{-28}\right) \land t \leq 1.6 \cdot 10^{+64}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.00000000000000013e85 or 3.0999999999999999e-52 < t < 1.14999999999999993e-28 or 1.60000000000000009e64 < t

    1. Initial program 91.3%

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

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

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

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

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

    if -9.00000000000000013e85 < t < 3.0999999999999999e-52 or 1.14999999999999993e-28 < t < 1.60000000000000009e64

    1. Initial program 97.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9 \cdot 10^{+85} \lor \neg \left(t \leq 3.1 \cdot 10^{-52} \lor \neg \left(t \leq 1.15 \cdot 10^{-28}\right) \land t \leq 1.6 \cdot 10^{+64}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 75.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.1 \cdot 10^{-28} \lor \neg \left(t \leq 7.5 \cdot 10^{+64}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.89999999999999999e83 or 6.99999999999999982e-48 < t < 1.09999999999999998e-28 or 7.5000000000000005e64 < t

    1. Initial program 91.3%

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

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

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

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

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

    if -2.89999999999999999e83 < t < 6.99999999999999982e-48

    1. Initial program 96.7%

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

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

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

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

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

    if 1.09999999999999998e-28 < t < 7.5000000000000005e64

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.9 \cdot 10^{+83}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;t \leq 7 \cdot 10^{-48}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-28} \lor \neg \left(t \leq 7.5 \cdot 10^{+64}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - x}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.35 \cdot 10^{+83}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-48}:\\ \;\;\;\;\frac{z - x}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-28}:\\ \;\;\;\;x - \frac{x \cdot y}{t}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -2.35e+83)
   (+ x (* y (/ z t)))
   (if (<= t 2.3e-48)
     (/ (- z x) (/ t y))
     (if (<= t 1.1e-28)
       (- x (/ (* x y) t))
       (if (<= t 3.5e+50) (/ (* (- z x) y) t) (+ x (/ (* z y) t)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -2.35e+83) {
		tmp = x + (y * (z / t));
	} else if (t <= 2.3e-48) {
		tmp = (z - x) / (t / y);
	} else if (t <= 1.1e-28) {
		tmp = x - ((x * y) / t);
	} else if (t <= 3.5e+50) {
		tmp = ((z - x) * 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 (t <= (-2.35d+83)) then
        tmp = x + (y * (z / t))
    else if (t <= 2.3d-48) then
        tmp = (z - x) / (t / y)
    else if (t <= 1.1d-28) then
        tmp = x - ((x * y) / t)
    else if (t <= 3.5d+50) then
        tmp = ((z - x) * 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 (t <= -2.35e+83) {
		tmp = x + (y * (z / t));
	} else if (t <= 2.3e-48) {
		tmp = (z - x) / (t / y);
	} else if (t <= 1.1e-28) {
		tmp = x - ((x * y) / t);
	} else if (t <= 3.5e+50) {
		tmp = ((z - x) * y) / t;
	} else {
		tmp = x + ((z * y) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -2.35e+83:
		tmp = x + (y * (z / t))
	elif t <= 2.3e-48:
		tmp = (z - x) / (t / y)
	elif t <= 1.1e-28:
		tmp = x - ((x * y) / t)
	elif t <= 3.5e+50:
		tmp = ((z - x) * y) / t
	else:
		tmp = x + ((z * y) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -2.35e+83)
		tmp = Float64(x + Float64(y * Float64(z / t)));
	elseif (t <= 2.3e-48)
		tmp = Float64(Float64(z - x) / Float64(t / y));
	elseif (t <= 1.1e-28)
		tmp = Float64(x - Float64(Float64(x * y) / t));
	elseif (t <= 3.5e+50)
		tmp = Float64(Float64(Float64(z - x) * y) / t);
	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 (t <= -2.35e+83)
		tmp = x + (y * (z / t));
	elseif (t <= 2.3e-48)
		tmp = (z - x) / (t / y);
	elseif (t <= 1.1e-28)
		tmp = x - ((x * y) / t);
	elseif (t <= 3.5e+50)
		tmp = ((z - x) * y) / t;
	else
		tmp = x + ((z * y) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.35e+83], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e-48], N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.1e-28], N[(x - N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+50], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{+83}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{elif}\;t \leq 2.3 \cdot 10^{-48}:\\
\;\;\;\;\frac{z - x}{\frac{t}{y}}\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{-28}:\\
\;\;\;\;x - \frac{x \cdot y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -2.3499999999999999e83

    1. Initial program 84.6%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified87.6%

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

    if -2.3499999999999999e83 < t < 2.3000000000000001e-48

    1. Initial program 96.7%

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

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

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

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

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

        \[\leadsto \left(z - x\right) \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv85.9%

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

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

    if 2.3000000000000001e-48 < t < 1.09999999999999998e-28

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\frac{-1 \cdot \left(x \cdot y\right)}{t}} \]
      2. mul-1-neg100.0%

        \[\leadsto x + \frac{\color{blue}{-x \cdot y}}{t} \]
      3. distribute-lft-neg-out100.0%

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

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

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

    if 1.09999999999999998e-28 < t < 3.50000000000000006e50

    1. Initial program 99.9%

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

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

    if 3.50000000000000006e50 < t

    1. Initial program 96.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.35 \cdot 10^{+83}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-48}:\\ \;\;\;\;\frac{z - x}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-28}:\\ \;\;\;\;x - \frac{x \cdot y}{t}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+83}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-52}:\\ \;\;\;\;\frac{z - x}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+47}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -5.2e+83)
   (+ x (* y (/ z t)))
   (if (<= t 3.2e-52)
     (/ (- z x) (/ t y))
     (if (<= t 1.15e-28)
       (* x (- 1.0 (/ y t)))
       (if (<= t 2.6e+47) (/ (* (- z x) y) t) (+ x (/ (* z y) t)))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.2e+83) {
		tmp = x + (y * (z / t));
	} else if (t <= 3.2e-52) {
		tmp = (z - x) / (t / y);
	} else if (t <= 1.15e-28) {
		tmp = x * (1.0 - (y / t));
	} else if (t <= 2.6e+47) {
		tmp = ((z - x) * 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 (t <= (-5.2d+83)) then
        tmp = x + (y * (z / t))
    else if (t <= 3.2d-52) then
        tmp = (z - x) / (t / y)
    else if (t <= 1.15d-28) then
        tmp = x * (1.0d0 - (y / t))
    else if (t <= 2.6d+47) then
        tmp = ((z - x) * 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 (t <= -5.2e+83) {
		tmp = x + (y * (z / t));
	} else if (t <= 3.2e-52) {
		tmp = (z - x) / (t / y);
	} else if (t <= 1.15e-28) {
		tmp = x * (1.0 - (y / t));
	} else if (t <= 2.6e+47) {
		tmp = ((z - x) * y) / t;
	} else {
		tmp = x + ((z * y) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -5.2e+83:
		tmp = x + (y * (z / t))
	elif t <= 3.2e-52:
		tmp = (z - x) / (t / y)
	elif t <= 1.15e-28:
		tmp = x * (1.0 - (y / t))
	elif t <= 2.6e+47:
		tmp = ((z - x) * y) / t
	else:
		tmp = x + ((z * y) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.2e+83)
		tmp = Float64(x + Float64(y * Float64(z / t)));
	elseif (t <= 3.2e-52)
		tmp = Float64(Float64(z - x) / Float64(t / y));
	elseif (t <= 1.15e-28)
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	elseif (t <= 2.6e+47)
		tmp = Float64(Float64(Float64(z - x) * y) / t);
	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 (t <= -5.2e+83)
		tmp = x + (y * (z / t));
	elseif (t <= 3.2e-52)
		tmp = (z - x) / (t / y);
	elseif (t <= 1.15e-28)
		tmp = x * (1.0 - (y / t));
	elseif (t <= 2.6e+47)
		tmp = ((z - x) * y) / t;
	else
		tmp = x + ((z * y) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e+83], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-52], N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-28], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+47], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+83}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{elif}\;t \leq 3.2 \cdot 10^{-52}:\\
\;\;\;\;\frac{z - x}{\frac{t}{y}}\\

\mathbf{elif}\;t \leq 1.15 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -5.2000000000000002e83

    1. Initial program 84.6%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified87.6%

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

    if -5.2000000000000002e83 < t < 3.2000000000000001e-52

    1. Initial program 96.7%

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

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

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

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

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

        \[\leadsto \left(z - x\right) \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv85.9%

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

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

    if 3.2000000000000001e-52 < t < 1.14999999999999993e-28

    1. Initial program 100.0%

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

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

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

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

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

    if 1.14999999999999993e-28 < t < 2.60000000000000003e47

    1. Initial program 99.9%

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

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

    if 2.60000000000000003e47 < t

    1. Initial program 96.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+83}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-52}:\\ \;\;\;\;\frac{z - x}{\frac{t}{y}}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+47}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 80.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+82}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{elif}\;t \leq 5.5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.15 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

\mathbf{elif}\;t \leq 1.72 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.90000000000000017e82

    1. Initial program 85.3%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified88.2%

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

    if -1.90000000000000017e82 < t < 5.50000000000000031e-49 or 1.14999999999999993e-28 < t < 1.72000000000000002e47

    1. Initial program 96.9%

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

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

    if 5.50000000000000031e-49 < t < 1.14999999999999993e-28

    1. Initial program 100.0%

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

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

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

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

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

    if 1.72000000000000002e47 < t

    1. Initial program 96.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{+82}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-49}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;t \leq 1.72 \cdot 10^{+47}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z \cdot y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 82.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{if}\;x \leq -4.2 \cdot 10^{-33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-202}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-107}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-50}:\\ \;\;\;\;x + \frac{z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y t)))))
   (if (<= x -4.2e-33)
     t_1
     (if (<= x 1.1e-202)
       (+ x (* y (/ z t)))
       (if (<= x 1.7e-107)
         (* (- z x) (/ y t))
         (if (<= x 2.4e-50) (+ x (/ z (/ t y))) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -4.2e-33) {
		tmp = t_1;
	} else if (x <= 1.1e-202) {
		tmp = x + (y * (z / t));
	} else if (x <= 1.7e-107) {
		tmp = (z - x) * (y / t);
	} else if (x <= 2.4e-50) {
		tmp = x + (z / (t / y));
	} 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 = x * (1.0d0 - (y / t))
    if (x <= (-4.2d-33)) then
        tmp = t_1
    else if (x <= 1.1d-202) then
        tmp = x + (y * (z / t))
    else if (x <= 1.7d-107) then
        tmp = (z - x) * (y / t)
    else if (x <= 2.4d-50) then
        tmp = x + (z / (t / y))
    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 = x * (1.0 - (y / t));
	double tmp;
	if (x <= -4.2e-33) {
		tmp = t_1;
	} else if (x <= 1.1e-202) {
		tmp = x + (y * (z / t));
	} else if (x <= 1.7e-107) {
		tmp = (z - x) * (y / t);
	} else if (x <= 2.4e-50) {
		tmp = x + (z / (t / y));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / t))
	tmp = 0
	if x <= -4.2e-33:
		tmp = t_1
	elif x <= 1.1e-202:
		tmp = x + (y * (z / t))
	elif x <= 1.7e-107:
		tmp = (z - x) * (y / t)
	elif x <= 2.4e-50:
		tmp = x + (z / (t / y))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / t)))
	tmp = 0.0
	if (x <= -4.2e-33)
		tmp = t_1;
	elseif (x <= 1.1e-202)
		tmp = Float64(x + Float64(y * Float64(z / t)));
	elseif (x <= 1.7e-107)
		tmp = Float64(Float64(z - x) * Float64(y / t));
	elseif (x <= 2.4e-50)
		tmp = Float64(x + Float64(z / Float64(t / y)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - (y / t));
	tmp = 0.0;
	if (x <= -4.2e-33)
		tmp = t_1;
	elseif (x <= 1.1e-202)
		tmp = x + (y * (z / t));
	elseif (x <= 1.7e-107)
		tmp = (z - x) * (y / t);
	elseif (x <= 2.4e-50)
		tmp = x + (z / (t / y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e-33], t$95$1, If[LessEqual[x, 1.1e-202], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7e-107], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.4e-50], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.2e-33 or 2.40000000000000002e-50 < x

    1. Initial program 94.5%

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

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

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

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

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

    if -4.2e-33 < x < 1.10000000000000004e-202

    1. Initial program 96.2%

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

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

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

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

    if 1.10000000000000004e-202 < x < 1.69999999999999997e-107

    1. Initial program 90.7%

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

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

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

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

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

    if 1.69999999999999997e-107 < x < 2.40000000000000002e-50

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/100.0%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    7. Simplified100.0%

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

Alternative 9: 82.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;x \leq 1.1 \cdot 10^{-202}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 2.55 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.2e-33 or 2.55000000000000023e-50 < x

    1. Initial program 94.5%

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

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

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

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

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

    if -4.2e-33 < x < 1.10000000000000004e-202 or 1.04999999999999996e-98 < x < 2.55000000000000023e-50

    1. Initial program 96.4%

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

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

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

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

    if 1.10000000000000004e-202 < x < 1.04999999999999996e-98

    1. Initial program 91.1%

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

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

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

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

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

Alternative 10: 72.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-226} \lor \neg \left(x \leq 2.25 \cdot 10^{-144}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.7999999999999999e-226 or 2.2499999999999999e-144 < x

    1. Initial program 95.9%

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

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

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

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

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

    if -4.7999999999999999e-226 < x < 2.2499999999999999e-144

    1. Initial program 92.1%

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

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Simplified78.1%

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

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

Alternative 11: 54.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+84}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.4999999999999999e84 or 5.00000000000000011e63 < t

    1. Initial program 90.7%

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

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

    if -3.4999999999999999e84 < t < 5.00000000000000011e63

    1. Initial program 97.1%

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{z}{t} \cdot y} \]
      3. associate-/r/65.5%

        \[\leadsto x + \color{blue}{\frac{z}{\frac{t}{y}}} \]
    8. Simplified53.3%

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

Alternative 12: 51.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+84}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.1999999999999996e84 or 3.9999999999999998e61 < t

    1. Initial program 90.7%

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

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

    if -9.1999999999999996e84 < t < 3.9999999999999998e61

    1. Initial program 97.1%

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

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Simplified49.2%

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

Alternative 13: 38.3% 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 94.8%

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

    \[\leadsto \color{blue}{x} \]
  4. 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 2024091 
(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)))