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

Percentage Accurate: 92.9% → 97.9%
Time: 7.9s
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: 92.9% accurate, 1.0× speedup?

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

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

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

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 85.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. +-commutative85.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x + \color{blue}{\frac{z - x}{\frac{t}{y}}} \]
  8. Add Preprocessing

Alternative 2: 53.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -5.4 \cdot 10^{+63}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-296}:\\ \;\;\;\;\frac{x}{\frac{-t}{y}}\\ \mathbf{elif}\;z \leq 260:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ y t))))
   (if (<= z -5.4e+63)
     t_1
     (if (<= z -1.65e-179)
       x
       (if (<= z -1.02e-296) (/ x (/ (- t) y)) (if (<= z 260.0) x t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (y / t);
	double tmp;
	if (z <= -5.4e+63) {
		tmp = t_1;
	} else if (z <= -1.65e-179) {
		tmp = x;
	} else if (z <= -1.02e-296) {
		tmp = x / (-t / y);
	} else if (z <= 260.0) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (y / t)
    if (z <= (-5.4d+63)) then
        tmp = t_1
    else if (z <= (-1.65d-179)) then
        tmp = x
    else if (z <= (-1.02d-296)) then
        tmp = x / (-t / y)
    else if (z <= 260.0d0) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (y / t);
	double tmp;
	if (z <= -5.4e+63) {
		tmp = t_1;
	} else if (z <= -1.65e-179) {
		tmp = x;
	} else if (z <= -1.02e-296) {
		tmp = x / (-t / y);
	} else if (z <= 260.0) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (y / t)
	tmp = 0
	if z <= -5.4e+63:
		tmp = t_1
	elif z <= -1.65e-179:
		tmp = x
	elif z <= -1.02e-296:
		tmp = x / (-t / y)
	elif z <= 260.0:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(y / t))
	tmp = 0.0
	if (z <= -5.4e+63)
		tmp = t_1;
	elseif (z <= -1.65e-179)
		tmp = x;
	elseif (z <= -1.02e-296)
		tmp = Float64(x / Float64(Float64(-t) / y));
	elseif (z <= 260.0)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (y / t);
	tmp = 0.0;
	if (z <= -5.4e+63)
		tmp = t_1;
	elseif (z <= -1.65e-179)
		tmp = x;
	elseif (z <= -1.02e-296)
		tmp = x / (-t / y);
	elseif (z <= 260.0)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e+63], t$95$1, If[LessEqual[z, -1.65e-179], x, If[LessEqual[z, -1.02e-296], N[(x / N[((-t) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 260.0], x, t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.65 \cdot 10^{-179}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 260:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.40000000000000035e63 or 260 < z

    1. Initial program 88.5%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Applied egg-rr62.1%

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

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

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

    if -5.40000000000000035e63 < z < -1.6499999999999999e-179 or -1.02000000000000002e-296 < z < 260

    1. Initial program 92.5%

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

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

    if -1.6499999999999999e-179 < z < -1.02000000000000002e-296

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

        \[\leadsto x + x \cdot \frac{\color{blue}{-y}}{t} \]
    6. Simplified60.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-296}:\\ \;\;\;\;\frac{x}{\frac{-t}{y}}\\ \mathbf{elif}\;z \leq 260:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -3.7 \cdot 10^{+62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-180}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 2.2:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (/ y t))))
   (if (<= z -3.7e+62)
     t_1
     (if (<= z -7e-180)
       x
       (if (<= z -1.1e-296) (* x (/ y (- t))) (if (<= z 2.2) x t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (y / t);
	double tmp;
	if (z <= -3.7e+62) {
		tmp = t_1;
	} else if (z <= -7e-180) {
		tmp = x;
	} else if (z <= -1.1e-296) {
		tmp = x * (y / -t);
	} else if (z <= 2.2) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (y / t)
    if (z <= (-3.7d+62)) then
        tmp = t_1
    else if (z <= (-7d-180)) then
        tmp = x
    else if (z <= (-1.1d-296)) then
        tmp = x * (y / -t)
    else if (z <= 2.2d0) then
        tmp = x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (y / t);
	double tmp;
	if (z <= -3.7e+62) {
		tmp = t_1;
	} else if (z <= -7e-180) {
		tmp = x;
	} else if (z <= -1.1e-296) {
		tmp = x * (y / -t);
	} else if (z <= 2.2) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (y / t)
	tmp = 0
	if z <= -3.7e+62:
		tmp = t_1
	elif z <= -7e-180:
		tmp = x
	elif z <= -1.1e-296:
		tmp = x * (y / -t)
	elif z <= 2.2:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(y / t))
	tmp = 0.0
	if (z <= -3.7e+62)
		tmp = t_1;
	elseif (z <= -7e-180)
		tmp = x;
	elseif (z <= -1.1e-296)
		tmp = Float64(x * Float64(y / Float64(-t)));
	elseif (z <= 2.2)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (y / t);
	tmp = 0.0;
	if (z <= -3.7e+62)
		tmp = t_1;
	elseif (z <= -7e-180)
		tmp = x;
	elseif (z <= -1.1e-296)
		tmp = x * (y / -t);
	elseif (z <= 2.2)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+62], t$95$1, If[LessEqual[z, -7e-180], x, If[LessEqual[z, -1.1e-296], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2], x, t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-180}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.2:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.70000000000000014e62 or 2.2000000000000002 < z

    1. Initial program 88.5%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Applied egg-rr62.1%

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

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

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

    if -3.70000000000000014e62 < z < -7.0000000000000001e-180 or -1.10000000000000006e-296 < z < 2.2000000000000002

    1. Initial program 92.5%

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

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

    if -7.0000000000000001e-180 < z < -1.10000000000000006e-296

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

        \[\leadsto x + x \cdot \frac{\color{blue}{-y}}{t} \]
    6. Simplified60.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+62}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-180}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 2.2:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 84.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x - x \cdot \frac{y}{t}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.4999999999999999e-6 or 5.50000000000000017e150 < z

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

    if -8.4999999999999999e-6 < z < 0.5

    1. Initial program 92.5%

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

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

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

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

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

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

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

        \[\leadsto x + x \cdot \frac{\color{blue}{-y}}{t} \]
    5. Simplified86.7%

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

    if 0.5 < z < 5.50000000000000017e150

    1. Initial program 89.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{-6}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x - x \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+150}:\\ \;\;\;\;\frac{z - x}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 84.0% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.012 or 5.50000000000000017e150 < z

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

    if -0.012 < z < 2.6e6

    1. Initial program 92.5%

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

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

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

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

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

    if 2.6e6 < z < 5.50000000000000017e150

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

Alternative 6: 84.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + z \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -3.6 \cdot 10^{-5}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 52000000:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+150}:\\ \;\;\;\;\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 (* z (/ y t)))))
   (if (<= z -3.6e-5)
     t_1
     (if (<= z 52000000.0)
       (* x (- 1.0 (/ y t)))
       (if (<= z 5.5e+150) (* (- z x) (/ y t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (z * (y / t));
	double tmp;
	if (z <= -3.6e-5) {
		tmp = t_1;
	} else if (z <= 52000000.0) {
		tmp = x * (1.0 - (y / t));
	} else if (z <= 5.5e+150) {
		tmp = (z - x) * (y / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (z * (y / t))
    if (z <= (-3.6d-5)) then
        tmp = t_1
    else if (z <= 52000000.0d0) then
        tmp = x * (1.0d0 - (y / t))
    else if (z <= 5.5d+150) then
        tmp = (z - x) * (y / t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (z * (y / t));
	double tmp;
	if (z <= -3.6e-5) {
		tmp = t_1;
	} else if (z <= 52000000.0) {
		tmp = x * (1.0 - (y / t));
	} else if (z <= 5.5e+150) {
		tmp = (z - x) * (y / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (z * (y / t))
	tmp = 0
	if z <= -3.6e-5:
		tmp = t_1
	elif z <= 52000000.0:
		tmp = x * (1.0 - (y / t))
	elif z <= 5.5e+150:
		tmp = (z - x) * (y / t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(z * Float64(y / t)))
	tmp = 0.0
	if (z <= -3.6e-5)
		tmp = t_1;
	elseif (z <= 52000000.0)
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	elseif (z <= 5.5e+150)
		tmp = 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 + (z * (y / t));
	tmp = 0.0;
	if (z <= -3.6e-5)
		tmp = t_1;
	elseif (z <= 52000000.0)
		tmp = x * (1.0 - (y / t));
	elseif (z <= 5.5e+150)
		tmp = (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[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.6e-5], t$95$1, If[LessEqual[z, 52000000.0], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+150], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;z \leq -3.6 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.60000000000000009e-5 or 5.50000000000000017e150 < z

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

    if -3.60000000000000009e-5 < z < 5.2e7

    1. Initial program 92.5%

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

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

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

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

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

    if 5.2e7 < z < 5.50000000000000017e150

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{t}\\ \mathbf{if}\;z \leq -6.4 \cdot 10^{+40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.5:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+159}:\\ \;\;\;\;\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 t)))))
   (if (<= z -6.4e+40)
     t_1
     (if (<= z 0.5)
       (* x (- 1.0 (/ y t)))
       (if (<= z 9e+159) (* (- z x) (/ y t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (y * (z / t));
	double tmp;
	if (z <= -6.4e+40) {
		tmp = t_1;
	} else if (z <= 0.5) {
		tmp = x * (1.0 - (y / t));
	} else if (z <= 9e+159) {
		tmp = (z - x) * (y / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * (z / t))
    if (z <= (-6.4d+40)) then
        tmp = t_1
    else if (z <= 0.5d0) then
        tmp = x * (1.0d0 - (y / t))
    else if (z <= 9d+159) then
        tmp = (z - x) * (y / t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (y * (z / t));
	double tmp;
	if (z <= -6.4e+40) {
		tmp = t_1;
	} else if (z <= 0.5) {
		tmp = x * (1.0 - (y / t));
	} else if (z <= 9e+159) {
		tmp = (z - x) * (y / t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (y * (z / t))
	tmp = 0
	if z <= -6.4e+40:
		tmp = t_1
	elif z <= 0.5:
		tmp = x * (1.0 - (y / t))
	elif z <= 9e+159:
		tmp = (z - x) * (y / t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(y * Float64(z / t)))
	tmp = 0.0
	if (z <= -6.4e+40)
		tmp = t_1;
	elseif (z <= 0.5)
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	elseif (z <= 9e+159)
		tmp = 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 / t));
	tmp = 0.0;
	if (z <= -6.4e+40)
		tmp = t_1;
	elseif (z <= 0.5)
		tmp = x * (1.0 - (y / t));
	elseif (z <= 9e+159)
		tmp = (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[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+40], t$95$1, If[LessEqual[z, 0.5], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+159], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.39999999999999961e40 or 9.00000000000000053e159 < z

    1. Initial program 88.7%

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

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

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

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

    if -6.39999999999999961e40 < z < 0.5

    1. Initial program 91.5%

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

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

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

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

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

    if 0.5 < z < 9.00000000000000053e159

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+60} \lor \neg \left(z \leq 0.8\right):\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.8000000000000005e60 or 0.80000000000000004 < z

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.8000000000000005e60 < z < 0.80000000000000004

    1. Initial program 91.1%

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

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

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

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

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

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

Alternative 9: 73.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+184} \lor \neg \left(z \leq 4.2 \cdot 10^{+40}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.39999999999999995e184 or 4.2000000000000002e40 < z

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

    if -1.39999999999999995e184 < z < 4.2000000000000002e40

    1. Initial program 91.5%

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

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

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

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

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

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

Alternative 10: 54.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+66} \lor \neg \left(z \leq 0.082\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999998e66 or 0.0820000000000000034 < z

    1. Initial program 88.5%

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Applied egg-rr62.1%

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

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

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

    if -4.4999999999999998e66 < z < 0.0820000000000000034

    1. Initial program 91.1%

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

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

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

Alternative 11: 52.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.20000000000000029e62 or 14000 < z

    1. Initial program 88.5%

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

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

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

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

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

    if -6.20000000000000029e62 < z < 14000

    1. Initial program 91.1%

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

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

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

Alternative 12: 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 89.9%

    \[x + \frac{y \cdot \left(z - x\right)}{t} \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 85.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. +-commutative85.2%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 38.5% 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 89.9%

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

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

Developer target: 91.2% 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 2024107 
(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)))