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

Percentage Accurate: 92.9% → 97.9%
Time: 7.7s
Alternatives: 14
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 14 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: 51.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.14 \cdot 10^{+64}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-167}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-296}:\\ \;\;\;\;\frac{x}{\frac{t}{-y}}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-92}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+83}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+87}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.14e+64)
   (* z (/ y t))
   (if (<= z -1.25e-167)
     x
     (if (<= z -1.1e-296)
       (/ x (/ t (- y)))
       (if (<= z 2.15e-92)
         x
         (if (<= z 1.95e+28)
           (* x (/ y (- t)))
           (if (<= z 1.15e+39)
             x
             (if (<= z 1.35e+83)
               (/ y (/ t z))
               (if (<= z 2.05e+87) x (/ z (/ t y)))))))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.14e+64) {
		tmp = z * (y / t);
	} else if (z <= -1.25e-167) {
		tmp = x;
	} else if (z <= -1.1e-296) {
		tmp = x / (t / -y);
	} else if (z <= 2.15e-92) {
		tmp = x;
	} else if (z <= 1.95e+28) {
		tmp = x * (y / -t);
	} else if (z <= 1.15e+39) {
		tmp = x;
	} else if (z <= 1.35e+83) {
		tmp = y / (t / z);
	} else if (z <= 2.05e+87) {
		tmp = x;
	} else {
		tmp = z / (t / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (z <= (-1.14d+64)) then
        tmp = z * (y / t)
    else if (z <= (-1.25d-167)) then
        tmp = x
    else if (z <= (-1.1d-296)) then
        tmp = x / (t / -y)
    else if (z <= 2.15d-92) then
        tmp = x
    else if (z <= 1.95d+28) then
        tmp = x * (y / -t)
    else if (z <= 1.15d+39) then
        tmp = x
    else if (z <= 1.35d+83) then
        tmp = y / (t / z)
    else if (z <= 2.05d+87) then
        tmp = x
    else
        tmp = z / (t / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.14e+64) {
		tmp = z * (y / t);
	} else if (z <= -1.25e-167) {
		tmp = x;
	} else if (z <= -1.1e-296) {
		tmp = x / (t / -y);
	} else if (z <= 2.15e-92) {
		tmp = x;
	} else if (z <= 1.95e+28) {
		tmp = x * (y / -t);
	} else if (z <= 1.15e+39) {
		tmp = x;
	} else if (z <= 1.35e+83) {
		tmp = y / (t / z);
	} else if (z <= 2.05e+87) {
		tmp = x;
	} else {
		tmp = z / (t / y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.14e+64:
		tmp = z * (y / t)
	elif z <= -1.25e-167:
		tmp = x
	elif z <= -1.1e-296:
		tmp = x / (t / -y)
	elif z <= 2.15e-92:
		tmp = x
	elif z <= 1.95e+28:
		tmp = x * (y / -t)
	elif z <= 1.15e+39:
		tmp = x
	elif z <= 1.35e+83:
		tmp = y / (t / z)
	elif z <= 2.05e+87:
		tmp = x
	else:
		tmp = z / (t / y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.14e+64)
		tmp = Float64(z * Float64(y / t));
	elseif (z <= -1.25e-167)
		tmp = x;
	elseif (z <= -1.1e-296)
		tmp = Float64(x / Float64(t / Float64(-y)));
	elseif (z <= 2.15e-92)
		tmp = x;
	elseif (z <= 1.95e+28)
		tmp = Float64(x * Float64(y / Float64(-t)));
	elseif (z <= 1.15e+39)
		tmp = x;
	elseif (z <= 1.35e+83)
		tmp = Float64(y / Float64(t / z));
	elseif (z <= 2.05e+87)
		tmp = x;
	else
		tmp = Float64(z / Float64(t / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.14e+64)
		tmp = z * (y / t);
	elseif (z <= -1.25e-167)
		tmp = x;
	elseif (z <= -1.1e-296)
		tmp = x / (t / -y);
	elseif (z <= 2.15e-92)
		tmp = x;
	elseif (z <= 1.95e+28)
		tmp = x * (y / -t);
	elseif (z <= 1.15e+39)
		tmp = x;
	elseif (z <= 1.35e+83)
		tmp = y / (t / z);
	elseif (z <= 2.05e+87)
		tmp = x;
	else
		tmp = z / (t / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.14e+64], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.25e-167], x, If[LessEqual[z, -1.1e-296], N[(x / N[(t / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-92], x, If[LessEqual[z, 1.95e+28], N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+39], x, If[LessEqual[z, 1.35e+83], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e+87], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-167}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-92}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+39}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.05 \cdot 10^{+87}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -1.14e64

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

    if -1.14e64 < z < -1.25000000000000005e-167 or -1.10000000000000006e-296 < z < 2.15000000000000007e-92 or 1.9499999999999999e28 < z < 1.15000000000000006e39 or 1.35000000000000003e83 < z < 2.05e87

    1. Initial program 91.0%

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

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

    if -1.25000000000000005e-167 < z < -1.10000000000000006e-296

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.15000000000000007e-92 < z < 1.9499999999999999e28

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

    if 1.15000000000000006e39 < z < 1.35000000000000003e83

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

    if 2.05e87 < 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 70.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num75.4%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    12. Applied egg-rr75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.14 \cdot 10^{+64}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-167}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-296}:\\ \;\;\;\;\frac{x}{\frac{t}{-y}}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-92}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+83}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+87}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 52.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{-t}\\ \mathbf{if}\;z \leq -1.65 \cdot 10^{+61}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-223}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.1 \cdot 10^{-92}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ y (- t)))))
   (if (<= z -1.65e+61)
     (* z (/ y t))
     (if (<= z -4e-179)
       x
       (if (<= z -1.15e-223)
         t_1
         (if (<= z 8.1e-92)
           x
           (if (<= z 5.8e+33) t_1 (if (<= z 1.45e+39) x (/ z (/ t y))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (y / -t);
	double tmp;
	if (z <= -1.65e+61) {
		tmp = z * (y / t);
	} else if (z <= -4e-179) {
		tmp = x;
	} else if (z <= -1.15e-223) {
		tmp = t_1;
	} else if (z <= 8.1e-92) {
		tmp = x;
	} else if (z <= 5.8e+33) {
		tmp = t_1;
	} else if (z <= 1.45e+39) {
		tmp = x;
	} else {
		tmp = z / (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 = x * (y / -t)
    if (z <= (-1.65d+61)) then
        tmp = z * (y / t)
    else if (z <= (-4d-179)) then
        tmp = x
    else if (z <= (-1.15d-223)) then
        tmp = t_1
    else if (z <= 8.1d-92) then
        tmp = x
    else if (z <= 5.8d+33) then
        tmp = t_1
    else if (z <= 1.45d+39) then
        tmp = x
    else
        tmp = z / (t / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (y / -t);
	double tmp;
	if (z <= -1.65e+61) {
		tmp = z * (y / t);
	} else if (z <= -4e-179) {
		tmp = x;
	} else if (z <= -1.15e-223) {
		tmp = t_1;
	} else if (z <= 8.1e-92) {
		tmp = x;
	} else if (z <= 5.8e+33) {
		tmp = t_1;
	} else if (z <= 1.45e+39) {
		tmp = x;
	} else {
		tmp = z / (t / y);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (y / -t)
	tmp = 0
	if z <= -1.65e+61:
		tmp = z * (y / t)
	elif z <= -4e-179:
		tmp = x
	elif z <= -1.15e-223:
		tmp = t_1
	elif z <= 8.1e-92:
		tmp = x
	elif z <= 5.8e+33:
		tmp = t_1
	elif z <= 1.45e+39:
		tmp = x
	else:
		tmp = z / (t / y)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(y / Float64(-t)))
	tmp = 0.0
	if (z <= -1.65e+61)
		tmp = Float64(z * Float64(y / t));
	elseif (z <= -4e-179)
		tmp = x;
	elseif (z <= -1.15e-223)
		tmp = t_1;
	elseif (z <= 8.1e-92)
		tmp = x;
	elseif (z <= 5.8e+33)
		tmp = t_1;
	elseif (z <= 1.45e+39)
		tmp = x;
	else
		tmp = Float64(z / Float64(t / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (y / -t);
	tmp = 0.0;
	if (z <= -1.65e+61)
		tmp = z * (y / t);
	elseif (z <= -4e-179)
		tmp = x;
	elseif (z <= -1.15e-223)
		tmp = t_1;
	elseif (z <= 8.1e-92)
		tmp = x;
	elseif (z <= 5.8e+33)
		tmp = t_1;
	elseif (z <= 1.45e+39)
		tmp = x;
	else
		tmp = z / (t / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+61], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4e-179], x, If[LessEqual[z, -1.15e-223], t$95$1, If[LessEqual[z, 8.1e-92], x, If[LessEqual[z, 5.8e+33], t$95$1, If[LessEqual[z, 1.45e+39], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-223}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8.1 \cdot 10^{-92}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+39}:\\
\;\;\;\;x\\

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


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

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

    if -1.6499999999999999e61 < z < -4.0000000000000001e-179 or -1.15e-223 < z < 8.09999999999999951e-92 or 5.80000000000000049e33 < z < 1.45000000000000015e39

    1. Initial program 90.9%

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

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

    if -4.0000000000000001e-179 < z < -1.15e-223 or 8.09999999999999951e-92 < z < 5.80000000000000049e33

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

    if 1.45000000000000015e39 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num73.4%

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

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    12. Applied egg-rr73.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+61}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-223}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 8.1 \cdot 10^{-92}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+33}:\\ \;\;\;\;x \cdot \frac{y}{-t}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+39}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 85.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\ t_2 := x + z \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -8.2 \cdot 10^{+40}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-282}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-282}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 45000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+50}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y t)))) (t_2 (+ x (* z (/ y t)))))
   (if (<= z -8.2e+40)
     t_2
     (if (<= z -3.6e-282)
       t_1
       (if (<= z -3.5e-282)
         (* y (/ z t))
         (if (<= z 45000000.0)
           t_1
           (if (<= z 7.8e+50) (/ (* (- z x) y) t) t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double t_2 = x + (z * (y / t));
	double tmp;
	if (z <= -8.2e+40) {
		tmp = t_2;
	} else if (z <= -3.6e-282) {
		tmp = t_1;
	} else if (z <= -3.5e-282) {
		tmp = y * (z / t);
	} else if (z <= 45000000.0) {
		tmp = t_1;
	} else if (z <= 7.8e+50) {
		tmp = ((z - x) * y) / t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / t))
    t_2 = x + (z * (y / t))
    if (z <= (-8.2d+40)) then
        tmp = t_2
    else if (z <= (-3.6d-282)) then
        tmp = t_1
    else if (z <= (-3.5d-282)) then
        tmp = y * (z / t)
    else if (z <= 45000000.0d0) then
        tmp = t_1
    else if (z <= 7.8d+50) then
        tmp = ((z - x) * y) / t
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double t_2 = x + (z * (y / t));
	double tmp;
	if (z <= -8.2e+40) {
		tmp = t_2;
	} else if (z <= -3.6e-282) {
		tmp = t_1;
	} else if (z <= -3.5e-282) {
		tmp = y * (z / t);
	} else if (z <= 45000000.0) {
		tmp = t_1;
	} else if (z <= 7.8e+50) {
		tmp = ((z - x) * y) / t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / t))
	t_2 = x + (z * (y / t))
	tmp = 0
	if z <= -8.2e+40:
		tmp = t_2
	elif z <= -3.6e-282:
		tmp = t_1
	elif z <= -3.5e-282:
		tmp = y * (z / t)
	elif z <= 45000000.0:
		tmp = t_1
	elif z <= 7.8e+50:
		tmp = ((z - x) * y) / t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / t)))
	t_2 = Float64(x + Float64(z * Float64(y / t)))
	tmp = 0.0
	if (z <= -8.2e+40)
		tmp = t_2;
	elseif (z <= -3.6e-282)
		tmp = t_1;
	elseif (z <= -3.5e-282)
		tmp = Float64(y * Float64(z / t));
	elseif (z <= 45000000.0)
		tmp = t_1;
	elseif (z <= 7.8e+50)
		tmp = Float64(Float64(Float64(z - x) * y) / t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - (y / t));
	t_2 = x + (z * (y / t));
	tmp = 0.0;
	if (z <= -8.2e+40)
		tmp = t_2;
	elseif (z <= -3.6e-282)
		tmp = t_1;
	elseif (z <= -3.5e-282)
		tmp = y * (z / t);
	elseif (z <= 45000000.0)
		tmp = t_1;
	elseif (z <= 7.8e+50)
		tmp = ((z - x) * y) / t;
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+40], t$95$2, If[LessEqual[z, -3.6e-282], t$95$1, If[LessEqual[z, -3.5e-282], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 45000000.0], t$95$1, If[LessEqual[z, 7.8e+50], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 45000000:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.2000000000000003e40 or 7.79999999999999935e50 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

    if -8.2000000000000003e40 < z < -3.5999999999999998e-282 or -3.50000000000000006e-282 < z < 4.5e7

    1. Initial program 92.1%

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

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

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

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

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

    if -3.5999999999999998e-282 < z < -3.50000000000000006e-282

    1. Initial program 4.0%

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

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

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

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

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

    if 4.5e7 < z < 7.79999999999999935e50

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+40}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-282}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-282}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 45000000:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+50}:\\ \;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\ t_2 := x + z \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -6.4 \cdot 10^{+40}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-282}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-282}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;z \leq 155:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.9 \cdot 10^{+47}:\\ \;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y t)))) (t_2 (+ x (* z (/ y t)))))
   (if (<= z -6.4e+40)
     t_2
     (if (<= z -3.6e-282)
       t_1
       (if (<= z -3.5e-282)
         (* y (/ z t))
         (if (<= z 155.0) t_1 (if (<= z 6.9e+47) (* (- z x) (/ y t)) t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double t_2 = x + (z * (y / t));
	double tmp;
	if (z <= -6.4e+40) {
		tmp = t_2;
	} else if (z <= -3.6e-282) {
		tmp = t_1;
	} else if (z <= -3.5e-282) {
		tmp = y * (z / t);
	} else if (z <= 155.0) {
		tmp = t_1;
	} else if (z <= 6.9e+47) {
		tmp = (z - x) * (y / t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / t))
    t_2 = x + (z * (y / t))
    if (z <= (-6.4d+40)) then
        tmp = t_2
    else if (z <= (-3.6d-282)) then
        tmp = t_1
    else if (z <= (-3.5d-282)) then
        tmp = y * (z / t)
    else if (z <= 155.0d0) then
        tmp = t_1
    else if (z <= 6.9d+47) then
        tmp = (z - x) * (y / t)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (y / t));
	double t_2 = x + (z * (y / t));
	double tmp;
	if (z <= -6.4e+40) {
		tmp = t_2;
	} else if (z <= -3.6e-282) {
		tmp = t_1;
	} else if (z <= -3.5e-282) {
		tmp = y * (z / t);
	} else if (z <= 155.0) {
		tmp = t_1;
	} else if (z <= 6.9e+47) {
		tmp = (z - x) * (y / t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (y / t))
	t_2 = x + (z * (y / t))
	tmp = 0
	if z <= -6.4e+40:
		tmp = t_2
	elif z <= -3.6e-282:
		tmp = t_1
	elif z <= -3.5e-282:
		tmp = y * (z / t)
	elif z <= 155.0:
		tmp = t_1
	elif z <= 6.9e+47:
		tmp = (z - x) * (y / t)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(y / t)))
	t_2 = Float64(x + Float64(z * Float64(y / t)))
	tmp = 0.0
	if (z <= -6.4e+40)
		tmp = t_2;
	elseif (z <= -3.6e-282)
		tmp = t_1;
	elseif (z <= -3.5e-282)
		tmp = Float64(y * Float64(z / t));
	elseif (z <= 155.0)
		tmp = t_1;
	elseif (z <= 6.9e+47)
		tmp = Float64(Float64(z - x) * Float64(y / t));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - (y / t));
	t_2 = x + (z * (y / t));
	tmp = 0.0;
	if (z <= -6.4e+40)
		tmp = t_2;
	elseif (z <= -3.6e-282)
		tmp = t_1;
	elseif (z <= -3.5e-282)
		tmp = y * (z / t);
	elseif (z <= 155.0)
		tmp = t_1;
	elseif (z <= 6.9e+47)
		tmp = (z - x) * (y / t);
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.4e+40], t$95$2, If[LessEqual[z, -3.6e-282], t$95$1, If[LessEqual[z, -3.5e-282], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 155.0], t$95$1, If[LessEqual[z, 6.9e+47], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;z \leq 155:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.39999999999999961e40 or 6.9000000000000004e47 < z

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

    if -6.39999999999999961e40 < z < -3.5999999999999998e-282 or -3.50000000000000006e-282 < z < 155

    1. Initial program 92.1%

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

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

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

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

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

    if -3.5999999999999998e-282 < z < -3.50000000000000006e-282

    1. Initial program 4.0%

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

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

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

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

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

    if 155 < z < 6.9000000000000004e47

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 77.3% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq 10^{+114} \lor \neg \left(z \leq 3.6 \cdot 10^{+114}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.45e69 or 1250 < z < 1e114 or 3.6000000000000001e114 < z

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

    if -2.45e69 < z < 1250

    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)} \]

    if 1e114 < z < 3.6000000000000001e114

    1. Initial program 100.0%

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

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

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

Alternative 7: 81.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z}{t}\\ \mathbf{if}\;z \leq -9 \cdot 10^{+73}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3600:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+108}:\\ \;\;\;\;\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 -9e+73)
     t_1
     (if (<= z 3600.0)
       (* x (- 1.0 (/ y t)))
       (if (<= z 5e+108) (* (- 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 <= -9e+73) {
		tmp = t_1;
	} else if (z <= 3600.0) {
		tmp = x * (1.0 - (y / t));
	} else if (z <= 5e+108) {
		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 <= (-9d+73)) then
        tmp = t_1
    else if (z <= 3600.0d0) then
        tmp = x * (1.0d0 - (y / t))
    else if (z <= 5d+108) 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 <= -9e+73) {
		tmp = t_1;
	} else if (z <= 3600.0) {
		tmp = x * (1.0 - (y / t));
	} else if (z <= 5e+108) {
		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 <= -9e+73:
		tmp = t_1
	elif z <= 3600.0:
		tmp = x * (1.0 - (y / t))
	elif z <= 5e+108:
		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 <= -9e+73)
		tmp = t_1;
	elseif (z <= 3600.0)
		tmp = Float64(x * Float64(1.0 - Float64(y / t)));
	elseif (z <= 5e+108)
		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 <= -9e+73)
		tmp = t_1;
	elseif (z <= 3600.0)
		tmp = x * (1.0 - (y / t));
	elseif (z <= 5e+108)
		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, -9e+73], t$95$1, If[LessEqual[z, 3600.0], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+108], 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 -9 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 5 \cdot 10^{+108}:\\
\;\;\;\;\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 < -8.99999999999999969e73 or 4.99999999999999991e108 < z

    1. Initial program 88.2%

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

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

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

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

    if -8.99999999999999969e73 < z < 3600

    1. Initial program 91.3%

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

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

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

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

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

    if 3600 < z < 4.99999999999999991e108

    1. Initial program 88.6%

      \[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 73.1%

      \[\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/87.8%

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

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

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

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

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

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

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

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

Alternative 8: 85.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+104}:\\ \;\;\;\;y \cdot \frac{z - x}{t}\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{+66}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{z - x}{\frac{t}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -6e+104)
   (* y (/ (- z x) t))
   (if (<= y 1.52e+66) (+ x (* z (/ y t))) (/ (- z x) (/ t y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -6e+104) {
		tmp = y * ((z - x) / t);
	} else if (y <= 1.52e+66) {
		tmp = x + (z * (y / t));
	} else {
		tmp = (z - x) / (t / y);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-6d+104)) then
        tmp = y * ((z - x) / t)
    else if (y <= 1.52d+66) then
        tmp = x + (z * (y / t))
    else
        tmp = (z - x) / (t / y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -6e+104) {
		tmp = y * ((z - x) / t);
	} else if (y <= 1.52e+66) {
		tmp = x + (z * (y / t));
	} else {
		tmp = (z - x) / (t / y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -6e+104:
		tmp = y * ((z - x) / t)
	elif y <= 1.52e+66:
		tmp = x + (z * (y / t))
	else:
		tmp = (z - x) / (t / y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -6e+104)
		tmp = Float64(y * Float64(Float64(z - x) / t));
	elseif (y <= 1.52e+66)
		tmp = Float64(x + Float64(z * Float64(y / t)));
	else
		tmp = Float64(Float64(z - x) / Float64(t / y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -6e+104)
		tmp = y * ((z - x) / t);
	elseif (y <= 1.52e+66)
		tmp = x + (z * (y / t));
	else
		tmp = (z - x) / (t / y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -6e+104], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.52e+66], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 1.52 \cdot 10^{+66}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.99999999999999937e104

    1. Initial program 86.2%

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

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

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

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

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

    if -5.99999999999999937e104 < y < 1.52000000000000004e66

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

    if 1.52000000000000004e66 < y

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

Alternative 9: 72.0% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.4999999999999999e231

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999999e231 < z < 1.1e8

    1. Initial program 91.1%

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

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

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

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

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

    if 1.1e8 < z

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num70.8%

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

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

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

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

Alternative 10: 54.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+63} \lor \neg \left(z \leq 2.45 \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 z < -4.00000000000000023e63 or 2.44999999999999987e-39 < z

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000023e63 < z < 2.44999999999999987e-39

    1. Initial program 90.8%

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

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

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

Alternative 11: 52.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.20000000000000004e74 or 0.070000000000000007 < z

    1. Initial program 88.3%

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

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

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

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

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

    if -1.20000000000000004e74 < z < 0.070000000000000007

    1. Initial program 91.3%

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

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

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

Alternative 12: 54.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

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

    if -5.19999999999999968e62 < z < 500

    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} \]

    if 500 < z

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
      2. clear-num70.8%

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

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

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

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

Alternative 13: 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 14: 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)))