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

Percentage Accurate: 93.2% → 98.7%
Time: 9.5s
Alternatives: 16
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 16 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.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 74.8%

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

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

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

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

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

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

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

        \[\leadsto x + \left(z \cdot \frac{y}{t} + \color{blue}{\left(-x\right) \cdot \frac{y}{t}}\right) \]
      7. distribute-rgt-in99.9%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z + \left(-x\right)\right)} \]
      8. sub-neg99.9%

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

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

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

    1. Initial program 99.3%

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

    if 5.00000000000000029e278 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 77.4%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - x}{t} + x} \]
    6. Applied egg-rr100.0%

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

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

Alternative 2: 99.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+303}\right):\\ \;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (/ (* y (- z x)) t))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+303)))
     (+ x (* (- z x) (/ y t)))
     t_1)))
double code(double x, double y, double z, double t) {
	double t_1 = x + ((y * (z - x)) / t);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+303)) {
		tmp = x + ((z - x) * (y / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = x + ((y * (z - x)) / t);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+303)) {
		tmp = x + ((z - x) * (y / t));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + ((y * (z - x)) / t)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 5e+303):
		tmp = x + ((z - x) * (y / t))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(Float64(y * Float64(z - x)) / t))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+303))
		tmp = Float64(x + Float64(Float64(z - x) * Float64(y / t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + ((y * (z - x)) / t);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 5e+303)))
		tmp = x + ((z - x) * (y / t));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+303]], $MachinePrecision]], N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 5 \cdot 10^{+303}\right):\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\

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


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

    1. Initial program 74.7%

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

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

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

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

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

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

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

        \[\leadsto x + \left(z \cdot \frac{y}{t} + \color{blue}{\left(-x\right) \cdot \frac{y}{t}}\right) \]
      7. distribute-rgt-in99.9%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z + \left(-x\right)\right)} \]
      8. sub-neg99.9%

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

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

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

    1. Initial program 99.4%

      \[x + \frac{y \cdot \left(z - x\right)}{t} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

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

Alternative 3: 99.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 74.8%

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

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

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

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

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

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

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

        \[\leadsto x + \left(z \cdot \frac{y}{t} + \color{blue}{\left(-x\right) \cdot \frac{y}{t}}\right) \]
      7. distribute-rgt-in99.9%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z + \left(-x\right)\right)} \]
      8. sub-neg99.9%

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

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

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

    1. Initial program 99.4%

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

    if 4.9999999999999997e303 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t))

    1. Initial program 74.6%

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

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

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

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

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

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

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

        \[\leadsto x + \left(z \cdot \frac{y}{t} + \color{blue}{\left(-x\right) \cdot \frac{y}{t}}\right) \]
      7. distribute-rgt-in99.9%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z + \left(-x\right)\right)} \]
      8. sub-neg99.9%

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

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

        \[\leadsto x + \color{blue}{\left(z - x\right) \cdot \frac{y}{t}} \]
      2. clear-num99.9%

        \[\leadsto x + \left(z - x\right) \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      3. un-div-inv100.0%

        \[\leadsto x + \color{blue}{\frac{z - x}{\frac{t}{y}}} \]
    7. Applied egg-rr100.0%

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

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

Alternative 4: 85.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+140} \lor \neg \left(x \leq -3.6 \cdot 10^{+31} \lor \neg \left(x \leq -1.25 \cdot 10^{+18}\right) \land x \leq 1.95 \cdot 10^{+51}\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 -6.2e+140)
         (not
          (or (<= x -3.6e+31) (and (not (<= x -1.25e+18)) (<= x 1.95e+51)))))
   (* x (- 1.0 (/ y t)))
   (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -6.2e+140) || !((x <= -3.6e+31) || (!(x <= -1.25e+18) && (x <= 1.95e+51)))) {
		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 <= (-6.2d+140)) .or. (.not. (x <= (-3.6d+31)) .or. (.not. (x <= (-1.25d+18))) .and. (x <= 1.95d+51))) 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 <= -6.2e+140) || !((x <= -3.6e+31) || (!(x <= -1.25e+18) && (x <= 1.95e+51)))) {
		tmp = x * (1.0 - (y / t));
	} else {
		tmp = x + (z * (y / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -6.2e+140) or not ((x <= -3.6e+31) or (not (x <= -1.25e+18) and (x <= 1.95e+51))):
		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 <= -6.2e+140) || !((x <= -3.6e+31) || (!(x <= -1.25e+18) && (x <= 1.95e+51))))
		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 <= -6.2e+140) || ~(((x <= -3.6e+31) || (~((x <= -1.25e+18)) && (x <= 1.95e+51)))))
		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, -6.2e+140], N[Not[Or[LessEqual[x, -3.6e+31], And[N[Not[LessEqual[x, -1.25e+18]], $MachinePrecision], LessEqual[x, 1.95e+51]]]], $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 -6.2 \cdot 10^{+140} \lor \neg \left(x \leq -3.6 \cdot 10^{+31} \lor \neg \left(x \leq -1.25 \cdot 10^{+18}\right) \land x \leq 1.95 \cdot 10^{+51}\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 < -6.2000000000000001e140 or -3.59999999999999996e31 < x < -1.25e18 or 1.94999999999999992e51 < x

    1. Initial program 87.4%

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

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

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

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

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

    if -6.2000000000000001e140 < x < -3.59999999999999996e31 or -1.25e18 < x < 1.94999999999999992e51

    1. Initial program 95.3%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    9. Applied egg-rr90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+140} \lor \neg \left(x \leq -3.6 \cdot 10^{+31} \lor \neg \left(x \leq -1.25 \cdot 10^{+18}\right) \land x \leq 1.95 \cdot 10^{+51}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+235}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq -2.35 \cdot 10^{+223} \lor \neg \left(z \leq -9.5 \cdot 10^{+78}\right) \land z \leq 6 \cdot 10^{-26}:\\ \;\;\;\;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 (<= z -4.8e+235)
   (* y (/ z t))
   (if (or (<= z -2.35e+223) (and (not (<= z -9.5e+78)) (<= z 6e-26)))
     (* x (- 1.0 (/ y t)))
     (* (- z x) (/ y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -4.8e+235) {
		tmp = y * (z / t);
	} else if ((z <= -2.35e+223) || (!(z <= -9.5e+78) && (z <= 6e-26))) {
		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 (z <= (-4.8d+235)) then
        tmp = y * (z / t)
    else if ((z <= (-2.35d+223)) .or. (.not. (z <= (-9.5d+78))) .and. (z <= 6d-26)) 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 (z <= -4.8e+235) {
		tmp = y * (z / t);
	} else if ((z <= -2.35e+223) || (!(z <= -9.5e+78) && (z <= 6e-26))) {
		tmp = x * (1.0 - (y / t));
	} else {
		tmp = (z - x) * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -4.8e+235:
		tmp = y * (z / t)
	elif (z <= -2.35e+223) or (not (z <= -9.5e+78) and (z <= 6e-26)):
		tmp = x * (1.0 - (y / t))
	else:
		tmp = (z - x) * (y / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -4.8e+235)
		tmp = Float64(y * Float64(z / t));
	elseif ((z <= -2.35e+223) || (!(z <= -9.5e+78) && (z <= 6e-26)))
		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 (z <= -4.8e+235)
		tmp = y * (z / t);
	elseif ((z <= -2.35e+223) || (~((z <= -9.5e+78)) && (z <= 6e-26)))
		tmp = x * (1.0 - (y / t));
	else
		tmp = (z - x) * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.8e+235], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -2.35e+223], And[N[Not[LessEqual[z, -9.5e+78]], $MachinePrecision], LessEqual[z, 6e-26]]], 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}\;z \leq -4.8 \cdot 10^{+235}:\\
\;\;\;\;y \cdot \frac{z}{t}\\

\mathbf{elif}\;z \leq -2.35 \cdot 10^{+223} \lor \neg \left(z \leq -9.5 \cdot 10^{+78}\right) \land z \leq 6 \cdot 10^{-26}:\\
\;\;\;\;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 3 regimes
  2. if z < -4.7999999999999998e235

    1. Initial program 87.3%

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

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

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

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

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

    if -4.7999999999999998e235 < z < -2.35000000000000021e223 or -9.5000000000000006e78 < z < 6.00000000000000023e-26

    1. Initial program 93.2%

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

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

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

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

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

    if -2.35000000000000021e223 < z < -9.5000000000000006e78 or 6.00000000000000023e-26 < z

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(z \cdot \frac{y}{t} + \color{blue}{\left(-x\right) \cdot \frac{y}{t}}\right) \]
      7. distribute-rgt-in99.7%

        \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z + \left(-x\right)\right)} \]
      8. sub-neg99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+235}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq -2.35 \cdot 10^{+223} \lor \neg \left(z \leq -9.5 \cdot 10^{+78}\right) \land z \leq 6 \cdot 10^{-26}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 72.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{if}\;z \leq -1.12 \cdot 10^{+234}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{+177}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+96}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+107}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y t)))))
   (if (<= z -1.12e+234)
     (* y (/ z t))
     (if (<= z -2.45e+177)
       t_1
       (if (<= z -2.3e+96)
         (/ (* y z) t)
         (if (<= z 1.32e+107) t_1 (* z (/ y t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double tmp;
	if (z <= -1.12e+234) {
		tmp = y * (z / t);
	} else if (z <= -2.45e+177) {
		tmp = t_1;
	} else if (z <= -2.3e+96) {
		tmp = (y * z) / t;
	} else if (z <= 1.32e+107) {
		tmp = t_1;
	} else {
		tmp = z * (y / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / t))
    if (z <= (-1.12d+234)) then
        tmp = y * (z / t)
    else if (z <= (-2.45d+177)) then
        tmp = t_1
    else if (z <= (-2.3d+96)) then
        tmp = (y * z) / t
    else if (z <= 1.32d+107) then
        tmp = t_1
    else
        tmp = z * (y / 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 (z <= -1.12e+234) {
		tmp = y * (z / t);
	} else if (z <= -2.45e+177) {
		tmp = t_1;
	} else if (z <= -2.3e+96) {
		tmp = (y * z) / t;
	} else if (z <= 1.32e+107) {
		tmp = t_1;
	} else {
		tmp = z * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / t))
	tmp = 0
	if z <= -1.12e+234:
		tmp = y * (z / t)
	elif z <= -2.45e+177:
		tmp = t_1
	elif z <= -2.3e+96:
		tmp = (y * z) / t
	elif z <= 1.32e+107:
		tmp = t_1
	else:
		tmp = z * (y / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / t)))
	tmp = 0.0
	if (z <= -1.12e+234)
		tmp = Float64(y * Float64(z / t));
	elseif (z <= -2.45e+177)
		tmp = t_1;
	elseif (z <= -2.3e+96)
		tmp = Float64(Float64(y * z) / t);
	elseif (z <= 1.32e+107)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - (y / t));
	tmp = 0.0;
	if (z <= -1.12e+234)
		tmp = y * (z / t);
	elseif (z <= -2.45e+177)
		tmp = t_1;
	elseif (z <= -2.3e+96)
		tmp = (y * z) / t;
	elseif (z <= 1.32e+107)
		tmp = t_1;
	else
		tmp = z * (y / 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[z, -1.12e+234], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.45e+177], t$95$1, If[LessEqual[z, -2.3e+96], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.32e+107], t$95$1, N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.45 \cdot 10^{+177}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.32 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.12000000000000004e234

    1. Initial program 87.3%

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

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

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

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

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

    if -1.12000000000000004e234 < z < -2.4500000000000001e177 or -2.30000000000000015e96 < z < 1.32000000000000003e107

    1. Initial program 93.6%

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

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

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

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

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

    if -2.4500000000000001e177 < z < -2.30000000000000015e96

    1. Initial program 99.8%

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

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

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

    if 1.32000000000000003e107 < z

    1. Initial program 86.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. associate-/r/79.1%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    10. Applied egg-rr79.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{+234}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{+177}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{+96}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{+107}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 52.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -7.8 \cdot 10^{-60}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -6.8000000000000003e67 or 1.75e6 < t

    1. Initial program 86.5%

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

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

    if -6.8000000000000003e67 < t < -7.8000000000000004e-60

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

    if -7.8000000000000004e-60 < t < -4.4000000000000004e-295

    1. Initial program 97.7%

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

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{t} \]
      2. distribute-lft-neg-out56.4%

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

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

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

    if -4.4000000000000004e-295 < t < 1.75e6

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -7.8 \cdot 10^{-60}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{-295}:\\ \;\;\;\;\frac{-x \cdot y}{t}\\ \mathbf{elif}\;t \leq 1750000:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 54.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-32}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.8e7 or 3.2000000000000002e-32 < y < 1.25000000000000008e192

    1. Initial program 87.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. associate-/r/54.0%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    10. Applied egg-rr54.0%

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

    if -1.8e7 < y < 3.2000000000000002e-32

    1. Initial program 99.1%

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

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

    if 1.25000000000000008e192 < y

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -18000000:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-32}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+192}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 54.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-44}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1e7 or 1.2999999999999999e-44 < y < 7.8000000000000001e191

    1. Initial program 87.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. associate-/r/54.0%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    10. Applied egg-rr54.0%

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

    if -2.1e7 < y < 1.2999999999999999e-44

    1. Initial program 99.1%

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

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

    if 7.8000000000000001e191 < y

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{-y}{t}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto x \cdot \frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{t} \]
      2. sqrt-unprod5.9%

        \[\leadsto x \cdot \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{t} \]
      3. sqr-neg5.9%

        \[\leadsto x \cdot \frac{\sqrt{\color{blue}{y \cdot y}}}{t} \]
      4. sqrt-unprod6.4%

        \[\leadsto x \cdot \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{t} \]
      5. add-sqr-sqrt6.4%

        \[\leadsto x \cdot \frac{\color{blue}{y}}{t} \]
      6. clear-num6.4%

        \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      7. div-inv6.4%

        \[\leadsto \color{blue}{\frac{x}{\frac{t}{y}}} \]
      8. frac-2neg6.4%

        \[\leadsto \color{blue}{\frac{-x}{-\frac{t}{y}}} \]
      9. distribute-frac-neg26.4%

        \[\leadsto \frac{-x}{\color{blue}{\frac{t}{-y}}} \]
      10. add-sqr-sqrt0.0%

        \[\leadsto \frac{-x}{\frac{t}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}} \]
      11. sqrt-unprod38.1%

        \[\leadsto \frac{-x}{\frac{t}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}} \]
      12. sqr-neg38.1%

        \[\leadsto \frac{-x}{\frac{t}{\sqrt{\color{blue}{y \cdot y}}}} \]
      13. sqrt-unprod57.1%

        \[\leadsto \frac{-x}{\frac{t}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}} \]
      14. add-sqr-sqrt57.2%

        \[\leadsto \frac{-x}{\frac{t}{\color{blue}{y}}} \]
    8. Applied egg-rr57.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -21000000:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-44}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+191}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{t}{-y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -18000000 \lor \neg \left(y \leq 3.3 \cdot 10^{-33}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.8e7 or 3.3000000000000003e-33 < y

    1. Initial program 86.9%

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

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

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

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

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

    if -1.8e7 < y < 3.3000000000000003e-33

    1. Initial program 99.1%

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

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

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

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

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

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

Alternative 11: 84.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.05 \cdot 10^{+15} \lor \neg \left(x \leq 6.5 \cdot 10^{+48}\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 -3.05e+15) (not (<= x 6.5e+48)))
   (* x (- 1.0 (/ y t)))
   (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -3.05e+15) || !(x <= 6.5e+48)) {
		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 <= (-3.05d+15)) .or. (.not. (x <= 6.5d+48))) 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 <= -3.05e+15) || !(x <= 6.5e+48)) {
		tmp = x * (1.0 - (y / t));
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -3.05e+15) or not (x <= 6.5e+48):
		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 <= -3.05e+15) || !(x <= 6.5e+48))
		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 <= -3.05e+15) || ~((x <= 6.5e+48)))
		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, -3.05e+15], N[Not[LessEqual[x, 6.5e+48]], $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 -3.05 \cdot 10^{+15} \lor \neg \left(x \leq 6.5 \cdot 10^{+48}\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 < -3.05e15 or 6.49999999999999972e48 < x

    1. Initial program 89.0%

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

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

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

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

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

    if -3.05e15 < x < 6.49999999999999972e48

    1. Initial program 95.3%

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

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

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

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

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

Alternative 12: 83.6% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.19999999999999998e-59

    1. Initial program 85.2%

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

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

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

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

    if -6.19999999999999998e-59 < t < 54

    1. Initial program 98.9%

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

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

    if 54 < t

    1. Initial program 91.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    9. Applied egg-rr95.1%

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

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

Alternative 13: 54.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -21000000 \lor \neg \left(y \leq 3.8 \cdot 10^{-44}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1e7 or 3.8000000000000001e-44 < y

    1. Initial program 86.9%

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

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

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

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

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

    if -2.1e7 < y < 3.8000000000000001e-44

    1. Initial program 99.1%

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

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

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

Alternative 14: 55.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -21000000 \lor \neg \left(y \leq 4.6 \cdot 10^{-39}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1e7 or 4.60000000000000016e-39 < y

    1. Initial program 86.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    9. Step-by-step derivation
      1. associate-/r/51.6%

        \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
    10. Applied egg-rr51.6%

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

    if -2.1e7 < y < 4.60000000000000016e-39

    1. Initial program 99.1%

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

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

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

Alternative 15: 97.7% 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.5%

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y}{t} \cdot \left(z + \left(-x\right)\right)} \]
    8. sub-neg96.6%

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

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

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

Alternative 16: 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.5%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification41.3%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 90.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
	return x - ((x * (y / t)) + (-z * (y / t)));
}
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 2024079 
(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)))