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

Percentage Accurate: 93.3% → 97.4%
Time: 13.0s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x - \frac{y \cdot \left(z - t\right)}{a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
	return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
	return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a):
	return x - ((y * (z - t)) / a)
function code(x, y, z, t, a)
	return Float64(x - Float64(Float64(y * Float64(z - t)) / a))
end
function tmp = code(x, y, z, t, a)
	tmp = x - ((y * (z - t)) / a);
end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{y \cdot \left(z - t\right)}{a}
\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 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 93.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{y \cdot \left(z - t\right)}{a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
	return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
	return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a):
	return x - ((y * (z - t)) / a)
function code(x, y, z, t, a)
	return Float64(x - Float64(Float64(y * Float64(z - t)) / a))
end
function tmp = code(x, y, z, t, a)
	tmp = x - ((y * (z - t)) / a);
end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}

Alternative 1: 97.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{t - z}{\frac{a}{y}} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
	return x + ((t - z) / (a / y));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + ((t - z) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((t - z) / (a / y));
}
def code(x, y, z, t, a):
	return x + ((t - z) / (a / y))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(t - z) / Float64(a / y)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((t - z) / (a / y));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
  7. Simplified96.9%

    \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
  8. Final simplification96.9%

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

Alternative 2: 68.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - z}{a}\\ \mathbf{if}\;y \leq -5.4 \cdot 10^{-49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-143}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-108}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{a}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-33}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t z) a))))
   (if (<= y -5.4e-49)
     t_1
     (if (<= y 7.2e-143)
       x
       (if (<= y 6.8e-108) (/ (* z (- y)) a) (if (<= y 2.7e-33) x t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - z) / a);
	double tmp;
	if (y <= -5.4e-49) {
		tmp = t_1;
	} else if (y <= 7.2e-143) {
		tmp = x;
	} else if (y <= 6.8e-108) {
		tmp = (z * -y) / a;
	} else if (y <= 2.7e-33) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((t - z) / a)
    if (y <= (-5.4d-49)) then
        tmp = t_1
    else if (y <= 7.2d-143) then
        tmp = x
    else if (y <= 6.8d-108) then
        tmp = (z * -y) / a
    else if (y <= 2.7d-33) 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 a) {
	double t_1 = y * ((t - z) / a);
	double tmp;
	if (y <= -5.4e-49) {
		tmp = t_1;
	} else if (y <= 7.2e-143) {
		tmp = x;
	} else if (y <= 6.8e-108) {
		tmp = (z * -y) / a;
	} else if (y <= 2.7e-33) {
		tmp = x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - z) / a)
	tmp = 0
	if y <= -5.4e-49:
		tmp = t_1
	elif y <= 7.2e-143:
		tmp = x
	elif y <= 6.8e-108:
		tmp = (z * -y) / a
	elif y <= 2.7e-33:
		tmp = x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - z) / a))
	tmp = 0.0
	if (y <= -5.4e-49)
		tmp = t_1;
	elseif (y <= 7.2e-143)
		tmp = x;
	elseif (y <= 6.8e-108)
		tmp = Float64(Float64(z * Float64(-y)) / a);
	elseif (y <= 2.7e-33)
		tmp = x;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - z) / a);
	tmp = 0.0;
	if (y <= -5.4e-49)
		tmp = t_1;
	elseif (y <= 7.2e-143)
		tmp = x;
	elseif (y <= 6.8e-108)
		tmp = (z * -y) / a;
	elseif (y <= 2.7e-33)
		tmp = x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.4e-49], t$95$1, If[LessEqual[y, 7.2e-143], x, If[LessEqual[y, 6.8e-108], N[(N[(z * (-y)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 2.7e-33], x, t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-143}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 6.8 \cdot 10^{-108}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{a}\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-33}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.3999999999999999e-49 or 2.7000000000000001e-33 < y

    1. Initial program 85.1%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot \left(z - t\right)}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg62.5%

        \[\leadsto \color{blue}{-\frac{y \cdot \left(z - t\right)}{a}} \]
      2. associate-*r/72.4%

        \[\leadsto -\color{blue}{y \cdot \frac{z - t}{a}} \]
      3. distribute-rgt-neg-out72.4%

        \[\leadsto \color{blue}{y \cdot \left(-\frac{z - t}{a}\right)} \]
      4. *-rgt-identity72.4%

        \[\leadsto y \cdot \color{blue}{\left(\left(-\frac{z - t}{a}\right) \cdot 1\right)} \]
      5. *-rgt-identity72.4%

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

        \[\leadsto y \cdot \color{blue}{\frac{-\left(z - t\right)}{a}} \]
      7. neg-sub072.4%

        \[\leadsto y \cdot \frac{\color{blue}{0 - \left(z - t\right)}}{a} \]
      8. associate--r-72.4%

        \[\leadsto y \cdot \frac{\color{blue}{\left(0 - z\right) + t}}{a} \]
      9. neg-sub072.4%

        \[\leadsto y \cdot \frac{\color{blue}{\left(-z\right)} + t}{a} \]
      10. +-commutative72.4%

        \[\leadsto y \cdot \frac{\color{blue}{t + \left(-z\right)}}{a} \]
      11. sub-neg72.4%

        \[\leadsto y \cdot \frac{\color{blue}{t - z}}{a} \]
    7. Simplified72.4%

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

    if -5.3999999999999999e-49 < y < 7.1999999999999996e-143 or 6.80000000000000004e-108 < y < 2.7000000000000001e-33

    1. Initial program 98.4%

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

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

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

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

    if 7.1999999999999996e-143 < y < 6.80000000000000004e-108

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg75.4%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. associate-*l/75.0%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. *-commutative75.0%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in75.0%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. *-lft-identity75.0%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{1 \cdot y}}{a}\right) \]
      6. associate-*l/75.0%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{1}{a} \cdot y}\right) \]
      7. remove-double-neg75.0%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-\left(-y\right)\right)}\right) \]
      8. neg-mul-175.0%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-1 \cdot \left(-y\right)\right)}\right) \]
      9. associate-*r*75.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(\frac{1}{a} \cdot -1\right) \cdot \left(-y\right)}\right) \]
      10. *-commutative75.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      11. neg-mul-175.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-\frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      12. *-commutative75.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-y\right) \cdot \left(-\frac{1}{a}\right)}\right) \]
      13. distribute-neg-frac75.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{-1}{a}}\right) \]
      14. metadata-eval75.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{-1}}{a}\right) \]
      15. metadata-eval75.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a}\right) \]
      16. associate-/r*75.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}}\right) \]
      17. neg-mul-175.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{1}{\color{blue}{-a}}\right) \]
      18. associate-*r/75.0%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{\left(-y\right) \cdot 1}{-a}}\right) \]
      19. *-rgt-identity75.0%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg75.0%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg75.0%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    7. Simplified75.0%

      \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. *-commutative75.0%

        \[\leadsto \color{blue}{\frac{y}{-a} \cdot z} \]
      2. frac-2neg75.0%

        \[\leadsto \color{blue}{\frac{-y}{-\left(-a\right)}} \cdot z \]
      3. remove-double-neg75.0%

        \[\leadsto \frac{-y}{\color{blue}{a}} \cdot z \]
      4. associate-*l/75.4%

        \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot z}{a}} \]
    9. Applied egg-rr75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{-49}:\\ \;\;\;\;y \cdot \frac{t - z}{a}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-143}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-108}:\\ \;\;\;\;\frac{z \cdot \left(-y\right)}{a}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-33}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y}{\frac{a}{z}}\\ \mathbf{if}\;z \leq -1.15 \cdot 10^{+55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;x - \frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+216}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+243}:\\ \;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ y (/ a z)))))
   (if (<= z -1.15e+55)
     t_1
     (if (<= z 0.68)
       (- x (/ y (/ (- a) t)))
       (if (<= z 5e+216)
         t_1
         (if (<= z 2.75e+243) (/ (* y (- t z)) a) (* z (/ y (- a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y / (a / z));
	double tmp;
	if (z <= -1.15e+55) {
		tmp = t_1;
	} else if (z <= 0.68) {
		tmp = x - (y / (-a / t));
	} else if (z <= 5e+216) {
		tmp = t_1;
	} else if (z <= 2.75e+243) {
		tmp = (y * (t - z)) / a;
	} else {
		tmp = z * (y / -a);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (y / (a / z))
    if (z <= (-1.15d+55)) then
        tmp = t_1
    else if (z <= 0.68d0) then
        tmp = x - (y / (-a / t))
    else if (z <= 5d+216) then
        tmp = t_1
    else if (z <= 2.75d+243) then
        tmp = (y * (t - z)) / a
    else
        tmp = z * (y / -a)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y / (a / z));
	double tmp;
	if (z <= -1.15e+55) {
		tmp = t_1;
	} else if (z <= 0.68) {
		tmp = x - (y / (-a / t));
	} else if (z <= 5e+216) {
		tmp = t_1;
	} else if (z <= 2.75e+243) {
		tmp = (y * (t - z)) / a;
	} else {
		tmp = z * (y / -a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (y / (a / z))
	tmp = 0
	if z <= -1.15e+55:
		tmp = t_1
	elif z <= 0.68:
		tmp = x - (y / (-a / t))
	elif z <= 5e+216:
		tmp = t_1
	elif z <= 2.75e+243:
		tmp = (y * (t - z)) / a
	else:
		tmp = z * (y / -a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(y / Float64(a / z)))
	tmp = 0.0
	if (z <= -1.15e+55)
		tmp = t_1;
	elseif (z <= 0.68)
		tmp = Float64(x - Float64(y / Float64(Float64(-a) / t)));
	elseif (z <= 5e+216)
		tmp = t_1;
	elseif (z <= 2.75e+243)
		tmp = Float64(Float64(y * Float64(t - z)) / a);
	else
		tmp = Float64(z * Float64(y / Float64(-a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (y / (a / z));
	tmp = 0.0;
	if (z <= -1.15e+55)
		tmp = t_1;
	elseif (z <= 0.68)
		tmp = x - (y / (-a / t));
	elseif (z <= 5e+216)
		tmp = t_1;
	elseif (z <= 2.75e+243)
		tmp = (y * (t - z)) / a;
	else
		tmp = z * (y / -a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+55], t$95$1, If[LessEqual[z, 0.68], N[(x - N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+216], t$95$1, If[LessEqual[z, 2.75e+243], N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - \frac{y}{\frac{a}{z}}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+55}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;x - \frac{y}{\frac{-a}{t}}\\

\mathbf{elif}\;z \leq 5 \cdot 10^{+216}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{+243}:\\
\;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.14999999999999994e55 or 0.680000000000000049 < z < 4.9999999999999998e216

    1. Initial program 85.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 80.2%

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

    if -1.14999999999999994e55 < z < 0.680000000000000049

    1. Initial program 96.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    3. Simplified96.4%

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 89.3%

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

        \[\leadsto x - \frac{y}{\color{blue}{\frac{-1 \cdot a}{t}}} \]
      2. neg-mul-189.3%

        \[\leadsto x - \frac{y}{\frac{\color{blue}{-a}}{t}} \]
    7. Simplified89.3%

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

    if 4.9999999999999998e216 < z < 2.75000000000000002e243

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, -\color{blue}{\left(z + \left(-t\right)\right)}, x\right) \]
      10. distribute-neg-in85.9%

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}, x\right) \]
      11. remove-double-neg85.9%

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{t + \left(-z\right)}, x\right) \]
      13. sub-neg85.9%

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

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

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

    if 2.75000000000000002e243 < z

    1. Initial program 81.4%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg71.7%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. associate-*l/90.0%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. *-commutative90.0%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in90.0%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. *-lft-identity90.0%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{1 \cdot y}}{a}\right) \]
      6. associate-*l/89.9%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{1}{a} \cdot y}\right) \]
      7. remove-double-neg89.9%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-\left(-y\right)\right)}\right) \]
      8. neg-mul-189.9%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-1 \cdot \left(-y\right)\right)}\right) \]
      9. associate-*r*89.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(\frac{1}{a} \cdot -1\right) \cdot \left(-y\right)}\right) \]
      10. *-commutative89.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      11. neg-mul-189.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-\frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      12. *-commutative89.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-y\right) \cdot \left(-\frac{1}{a}\right)}\right) \]
      13. distribute-neg-frac89.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{-1}{a}}\right) \]
      14. metadata-eval89.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{-1}}{a}\right) \]
      15. metadata-eval89.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a}\right) \]
      16. associate-/r*89.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}}\right) \]
      17. neg-mul-189.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{1}{\color{blue}{-a}}\right) \]
      18. associate-*r/90.0%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{\left(-y\right) \cdot 1}{-a}}\right) \]
      19. *-rgt-identity90.0%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg90.0%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg90.0%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    7. Simplified90.0%

      \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification86.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+55}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq 0.68:\\ \;\;\;\;x - \frac{y}{\frac{-a}{t}}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+216}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+243}:\\ \;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 51.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{-a}\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+60}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{-198}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 4.9 \cdot 10^{-161}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+119}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.45e60 or 4.6000000000000001e119 < z

    1. Initial program 83.0%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg56.3%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. associate-*l/65.1%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. *-commutative65.1%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in65.1%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. *-lft-identity65.1%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{1 \cdot y}}{a}\right) \]
      6. associate-*l/65.0%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{1}{a} \cdot y}\right) \]
      7. remove-double-neg65.0%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-\left(-y\right)\right)}\right) \]
      8. neg-mul-165.0%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-1 \cdot \left(-y\right)\right)}\right) \]
      9. associate-*r*65.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(\frac{1}{a} \cdot -1\right) \cdot \left(-y\right)}\right) \]
      10. *-commutative65.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      11. neg-mul-165.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-\frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      12. *-commutative65.0%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-y\right) \cdot \left(-\frac{1}{a}\right)}\right) \]
      13. distribute-neg-frac65.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{-1}{a}}\right) \]
      14. metadata-eval65.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{-1}}{a}\right) \]
      15. metadata-eval65.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a}\right) \]
      16. associate-/r*65.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}}\right) \]
      17. neg-mul-165.0%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{1}{\color{blue}{-a}}\right) \]
      18. associate-*r/65.1%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{\left(-y\right) \cdot 1}{-a}}\right) \]
      19. *-rgt-identity65.1%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg65.1%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg65.1%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    7. Simplified65.1%

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

    if -1.45e60 < z < 1.79999999999999999e-198 or 4.90000000000000035e-161 < z < 4.6000000000000001e119

    1. Initial program 95.6%

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

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

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

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

    if 1.79999999999999999e-198 < z < 4.90000000000000035e-161

    1. Initial program 99.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified82.9%

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

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

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    7. Simplified82.5%

      \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    8. Taylor expanded in t around inf 73.8%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
      2. *-commutative73.9%

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    10. Simplified73.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+60}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-198}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{-161}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 51.0% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{-161}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

\mathbf{elif}\;z \leq 4.9 \cdot 10^{+119}:\\
\;\;\;\;x\\

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


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

    1. Initial program 82.4%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified99.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg50.7%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. associate-*l/60.9%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. *-commutative60.9%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in60.9%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. *-lft-identity60.9%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{1 \cdot y}}{a}\right) \]
      6. associate-*l/60.9%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{1}{a} \cdot y}\right) \]
      7. remove-double-neg60.9%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-\left(-y\right)\right)}\right) \]
      8. neg-mul-160.9%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-1 \cdot \left(-y\right)\right)}\right) \]
      9. associate-*r*60.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(\frac{1}{a} \cdot -1\right) \cdot \left(-y\right)}\right) \]
      10. *-commutative60.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      11. neg-mul-160.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-\frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      12. *-commutative60.9%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-y\right) \cdot \left(-\frac{1}{a}\right)}\right) \]
      13. distribute-neg-frac60.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{-1}{a}}\right) \]
      14. metadata-eval60.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{-1}}{a}\right) \]
      15. metadata-eval60.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a}\right) \]
      16. associate-/r*60.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}}\right) \]
      17. neg-mul-160.9%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{1}{\color{blue}{-a}}\right) \]
      18. associate-*r/60.9%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{\left(-y\right) \cdot 1}{-a}}\right) \]
      19. *-rgt-identity60.9%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg60.9%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg60.9%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    7. Simplified60.9%

      \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt42.3%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      2. sqrt-unprod26.0%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}} \]
      3. sqr-neg26.0%

        \[\leadsto z \cdot \frac{y}{\sqrt{\color{blue}{a \cdot a}}} \]
      4. sqrt-unprod2.3%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      5. add-sqr-sqrt2.9%

        \[\leadsto z \cdot \frac{y}{\color{blue}{a}} \]
      6. clear-num2.9%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      7. div-inv2.9%

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
      8. frac-2neg2.9%

        \[\leadsto \color{blue}{\frac{-z}{-\frac{a}{y}}} \]
      9. distribute-frac-neg2.9%

        \[\leadsto \frac{-z}{\color{blue}{\frac{-a}{y}}} \]
      10. add-sqr-sqrt0.6%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}}{y}} \]
      11. sqrt-unprod15.5%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{y}} \]
      12. sqr-neg15.5%

        \[\leadsto \frac{-z}{\frac{\sqrt{\color{blue}{a \cdot a}}}{y}} \]
      13. sqrt-unprod18.4%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{y}} \]
      14. add-sqr-sqrt60.9%

        \[\leadsto \frac{-z}{\frac{\color{blue}{a}}{y}} \]
    9. Applied egg-rr60.9%

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

    if -3e59 < z < 1.2500000000000001e-197 or 2.79999999999999992e-161 < z < 4.89999999999999996e119

    1. Initial program 95.6%

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

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

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

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

    if 1.2500000000000001e-197 < z < 2.79999999999999992e-161

    1. Initial program 99.7%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified82.9%

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

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

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    7. Simplified82.5%

      \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    8. Taylor expanded in t around inf 73.8%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
      2. *-commutative73.9%

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    10. Simplified73.9%

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

    if 4.89999999999999996e119 < z

    1. Initial program 84.2%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg68.2%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. associate-*l/74.0%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. *-commutative74.0%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in74.0%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. *-lft-identity74.0%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{1 \cdot y}}{a}\right) \]
      6. associate-*l/73.7%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{1}{a} \cdot y}\right) \]
      7. remove-double-neg73.7%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-\left(-y\right)\right)}\right) \]
      8. neg-mul-173.7%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-1 \cdot \left(-y\right)\right)}\right) \]
      9. associate-*r*73.7%

        \[\leadsto z \cdot \left(-\color{blue}{\left(\frac{1}{a} \cdot -1\right) \cdot \left(-y\right)}\right) \]
      10. *-commutative73.7%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      11. neg-mul-173.7%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-\frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      12. *-commutative73.7%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-y\right) \cdot \left(-\frac{1}{a}\right)}\right) \]
      13. distribute-neg-frac73.7%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{-1}{a}}\right) \]
      14. metadata-eval73.7%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{-1}}{a}\right) \]
      15. metadata-eval73.7%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a}\right) \]
      16. associate-/r*73.7%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}}\right) \]
      17. neg-mul-173.7%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{1}{\color{blue}{-a}}\right) \]
      18. associate-*r/74.0%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{\left(-y\right) \cdot 1}{-a}}\right) \]
      19. *-rgt-identity74.0%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg74.0%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg74.0%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    7. Simplified74.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+59}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-197}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-161}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{+119}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 77.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+132} \lor \neg \left(z \leq 1.05 \cdot 10^{+175}\right):\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.04999999999999996e132 or 1.05e175 < z

    1. Initial program 80.9%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified98.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg58.7%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. associate-*l/71.5%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. *-commutative71.5%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in71.5%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. *-lft-identity71.5%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{1 \cdot y}}{a}\right) \]
      6. associate-*l/71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{1}{a} \cdot y}\right) \]
      7. remove-double-neg71.5%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-\left(-y\right)\right)}\right) \]
      8. neg-mul-171.5%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-1 \cdot \left(-y\right)\right)}\right) \]
      9. associate-*r*71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(\frac{1}{a} \cdot -1\right) \cdot \left(-y\right)}\right) \]
      10. *-commutative71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      11. neg-mul-171.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-\frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      12. *-commutative71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-y\right) \cdot \left(-\frac{1}{a}\right)}\right) \]
      13. distribute-neg-frac71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{-1}{a}}\right) \]
      14. metadata-eval71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{-1}}{a}\right) \]
      15. metadata-eval71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a}\right) \]
      16. associate-/r*71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}}\right) \]
      17. neg-mul-171.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{1}{\color{blue}{-a}}\right) \]
      18. associate-*r/71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{\left(-y\right) \cdot 1}{-a}}\right) \]
      19. *-rgt-identity71.5%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg71.5%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg71.5%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    7. Simplified71.5%

      \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt47.0%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}} \]
      3. sqr-neg25.7%

        \[\leadsto z \cdot \frac{y}{\sqrt{\color{blue}{a \cdot a}}} \]
      4. sqrt-unprod2.2%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      5. add-sqr-sqrt2.8%

        \[\leadsto z \cdot \frac{y}{\color{blue}{a}} \]
      6. clear-num2.7%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      7. div-inv2.7%

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
      8. frac-2neg2.7%

        \[\leadsto \color{blue}{\frac{-z}{-\frac{a}{y}}} \]
      9. distribute-frac-neg2.7%

        \[\leadsto \frac{-z}{\color{blue}{\frac{-a}{y}}} \]
      10. add-sqr-sqrt0.6%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}}{y}} \]
      11. sqrt-unprod18.0%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{y}} \]
      12. sqr-neg18.0%

        \[\leadsto \frac{-z}{\frac{\sqrt{\color{blue}{a \cdot a}}}{y}} \]
      13. sqrt-unprod24.3%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{y}} \]
      14. add-sqr-sqrt71.6%

        \[\leadsto \frac{-z}{\frac{\color{blue}{a}}{y}} \]
    9. Applied egg-rr71.6%

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

    if -2.04999999999999996e132 < z < 1.05e175

    1. Initial program 94.6%

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

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv81.1%

        \[\leadsto \color{blue}{x + \left(--1\right) \cdot \frac{t \cdot y}{a}} \]
      2. metadata-eval81.1%

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity81.1%

        \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
      4. +-commutative81.1%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      5. associate-*r/83.6%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified83.6%

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

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

Alternative 7: 77.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+134} \lor \neg \left(z \leq 1.4 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.40000000000000018e134 or 1.4e172 < z

    1. Initial program 80.9%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified98.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg58.7%

        \[\leadsto \color{blue}{-\frac{y \cdot z}{a}} \]
      2. associate-*l/71.5%

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot z} \]
      3. *-commutative71.5%

        \[\leadsto -\color{blue}{z \cdot \frac{y}{a}} \]
      4. distribute-rgt-neg-in71.5%

        \[\leadsto \color{blue}{z \cdot \left(-\frac{y}{a}\right)} \]
      5. *-lft-identity71.5%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{1 \cdot y}}{a}\right) \]
      6. associate-*l/71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{1}{a} \cdot y}\right) \]
      7. remove-double-neg71.5%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-\left(-y\right)\right)}\right) \]
      8. neg-mul-171.5%

        \[\leadsto z \cdot \left(-\frac{1}{a} \cdot \color{blue}{\left(-1 \cdot \left(-y\right)\right)}\right) \]
      9. associate-*r*71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(\frac{1}{a} \cdot -1\right) \cdot \left(-y\right)}\right) \]
      10. *-commutative71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-1 \cdot \frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      11. neg-mul-171.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-\frac{1}{a}\right)} \cdot \left(-y\right)\right) \]
      12. *-commutative71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\left(-y\right) \cdot \left(-\frac{1}{a}\right)}\right) \]
      13. distribute-neg-frac71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{-1}{a}}\right) \]
      14. metadata-eval71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{-1}}{a}\right) \]
      15. metadata-eval71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{\color{blue}{\frac{1}{-1}}}{a}\right) \]
      16. associate-/r*71.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \color{blue}{\frac{1}{-1 \cdot a}}\right) \]
      17. neg-mul-171.5%

        \[\leadsto z \cdot \left(-\left(-y\right) \cdot \frac{1}{\color{blue}{-a}}\right) \]
      18. associate-*r/71.5%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{\left(-y\right) \cdot 1}{-a}}\right) \]
      19. *-rgt-identity71.5%

        \[\leadsto z \cdot \left(-\frac{\color{blue}{-y}}{-a}\right) \]
      20. distribute-frac-neg71.5%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      21. remove-double-neg71.5%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    7. Simplified71.5%

      \[\leadsto \color{blue}{z \cdot \frac{y}{-a}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt47.0%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}} \]
      3. sqr-neg25.7%

        \[\leadsto z \cdot \frac{y}{\sqrt{\color{blue}{a \cdot a}}} \]
      4. sqrt-unprod2.2%

        \[\leadsto z \cdot \frac{y}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}} \]
      5. add-sqr-sqrt2.8%

        \[\leadsto z \cdot \frac{y}{\color{blue}{a}} \]
      6. clear-num2.7%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      7. div-inv2.7%

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} \]
      8. frac-2neg2.7%

        \[\leadsto \color{blue}{\frac{-z}{-\frac{a}{y}}} \]
      9. distribute-frac-neg2.7%

        \[\leadsto \frac{-z}{\color{blue}{\frac{-a}{y}}} \]
      10. add-sqr-sqrt0.6%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}}{y}} \]
      11. sqrt-unprod18.0%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{y}} \]
      12. sqr-neg18.0%

        \[\leadsto \frac{-z}{\frac{\sqrt{\color{blue}{a \cdot a}}}{y}} \]
      13. sqrt-unprod24.3%

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{y}} \]
      14. add-sqr-sqrt71.6%

        \[\leadsto \frac{-z}{\frac{\color{blue}{a}}{y}} \]
    9. Applied egg-rr71.6%

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

    if -3.40000000000000018e134 < z < 1.4e172

    1. Initial program 94.6%

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

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv81.1%

        \[\leadsto \color{blue}{x + \left(--1\right) \cdot \frac{t \cdot y}{a}} \]
      2. metadata-eval81.1%

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity81.1%

        \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
      4. +-commutative81.1%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      5. associate-*r/83.6%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified83.6%

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

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      2. div-inv34.0%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr83.9%

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

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

Alternative 8: 82.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t \leq 9.5 \cdot 10^{+176}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\

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


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

    1. Initial program 90.4%

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

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv75.3%

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

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity75.3%

        \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
      4. +-commutative75.3%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      5. associate-*r/80.6%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified80.6%

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

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      2. div-inv51.4%

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

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

    if -6.80000000000000035e-59 < t < 9.4999999999999995e176

    1. Initial program 92.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{z - t}}} \]
    3. Simplified92.9%

      \[\leadsto \color{blue}{x - \frac{y}{\frac{a}{z - t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 81.8%

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

    if 9.4999999999999995e176 < t

    1. Initial program 87.5%

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

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

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

      \[\leadsto \color{blue}{x - -1 \cdot \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv83.6%

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

        \[\leadsto x + \color{blue}{1} \cdot \frac{t \cdot y}{a} \]
      3. *-lft-identity83.6%

        \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
      4. +-commutative83.6%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      5. associate-*r/96.1%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified96.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{-59}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+176}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 50.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+69} \lor \neg \left(y \leq 2.2 \cdot 10^{+175}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.5000000000000002e69 or 2.1999999999999999e175 < y

    1. Initial program 81.4%

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Simplified54.9%

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

    if -8.5000000000000002e69 < y < 2.1999999999999999e175

    1. Initial program 95.8%

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

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

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

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

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

Alternative 10: 49.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+71}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+175}:\\
\;\;\;\;x\\

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


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

    1. Initial program 81.1%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified97.9%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Simplified61.7%

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

    if -1.75e71 < y < 3.0000000000000002e175

    1. Initial program 95.8%

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

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

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

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

    if 3.0000000000000002e175 < y

    1. Initial program 81.8%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    7. Simplified93.9%

      \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    8. Taylor expanded in t around inf 46.7%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
      2. *-commutative46.5%

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    10. Simplified46.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+71}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+175}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 49.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.08 \cdot 10^{+71}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq 1.06 \cdot 10^{+182}:\\
\;\;\;\;x\\

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


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

    1. Initial program 81.1%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified97.9%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Simplified61.7%

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

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      2. div-inv61.8%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr61.8%

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

    if -1.08e71 < y < 1.0599999999999999e182

    1. Initial program 95.8%

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

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

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

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

    if 1.0599999999999999e182 < y

    1. Initial program 81.8%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    7. Simplified93.9%

      \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    8. Taylor expanded in t around inf 46.7%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
      2. *-commutative46.5%

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    10. Simplified46.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{+71}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+182}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 49.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.45 \cdot 10^{+67}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq 2.25 \cdot 10^{+175}:\\
\;\;\;\;x\\

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


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

    1. Initial program 81.1%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified97.9%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Simplified61.7%

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

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      2. div-inv61.8%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr61.8%

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

    if -2.44999999999999995e67 < y < 2.24999999999999995e175

    1. Initial program 95.8%

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

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

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

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

    if 2.24999999999999995e175 < y

    1. Initial program 81.8%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    7. Simplified93.9%

      \[\leadsto x - \color{blue}{\frac{z - t}{\frac{a}{y}}} \]
    8. Taylor expanded in t around inf 46.7%

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot y} \]
      2. *-commutative46.5%

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    10. Simplified46.5%

      \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    11. Step-by-step derivation
      1. associate-*r/46.7%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} \]
    12. Applied egg-rr46.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.45 \cdot 10^{+67}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 2.25 \cdot 10^{+175}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 49.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+69}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+175}:\\
\;\;\;\;x\\

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


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

    1. Initial program 81.1%

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

        \[\leadsto x - \color{blue}{\frac{y}{a} \cdot \left(z - t\right)} \]
    3. Simplified97.9%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Simplified61.7%

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

        \[\leadsto t \cdot \color{blue}{\frac{1}{\frac{a}{y}}} \]
      2. div-inv61.8%

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    9. Applied egg-rr61.8%

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

    if -6.99999999999999974e69 < y < 2.1999999999999999e175

    1. Initial program 95.8%

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

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

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

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

    if 2.1999999999999999e175 < y

    1. Initial program 81.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot t}}{a} \]
    7. Simplified46.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+69}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{+175}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 97.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{a} \cdot \left(t - z\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
	return x + ((y / a) * (t - z));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + ((y / a) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a):
	return x + ((y / a) * (t - z))
function code(x, y, z, t, a)
	return Float64(x + Float64(Float64(y / a) * Float64(t - z)))
end
function tmp = code(x, y, z, t, a)
	tmp = x + ((y / a) * (t - z));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

Alternative 15: 39.6% accurate, 9.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 91.2%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification44.2%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{a}{z - t}\\ \mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\ \;\;\;\;x - \frac{1}{\frac{t_1}{y}}\\ \mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\ \;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{t_1}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ a (- z t))))
   (if (< y -1.0761266216389975e-10)
     (- x (/ 1.0 (/ t_1 y)))
     (if (< y 2.894426862792089e-49)
       (- x (/ (* y (- z t)) a))
       (- x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = a / (z - t);
	double tmp;
	if (y < -1.0761266216389975e-10) {
		tmp = x - (1.0 / (t_1 / y));
	} else if (y < 2.894426862792089e-49) {
		tmp = x - ((y * (z - t)) / a);
	} else {
		tmp = x - (y / t_1);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = a / (z - t)
    if (y < (-1.0761266216389975d-10)) then
        tmp = x - (1.0d0 / (t_1 / y))
    else if (y < 2.894426862792089d-49) then
        tmp = x - ((y * (z - t)) / a)
    else
        tmp = x - (y / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = a / (z - t);
	double tmp;
	if (y < -1.0761266216389975e-10) {
		tmp = x - (1.0 / (t_1 / y));
	} else if (y < 2.894426862792089e-49) {
		tmp = x - ((y * (z - t)) / a);
	} else {
		tmp = x - (y / t_1);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = a / (z - t)
	tmp = 0
	if y < -1.0761266216389975e-10:
		tmp = x - (1.0 / (t_1 / y))
	elif y < 2.894426862792089e-49:
		tmp = x - ((y * (z - t)) / a)
	else:
		tmp = x - (y / t_1)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(a / Float64(z - t))
	tmp = 0.0
	if (y < -1.0761266216389975e-10)
		tmp = Float64(x - Float64(1.0 / Float64(t_1 / y)));
	elseif (y < 2.894426862792089e-49)
		tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a));
	else
		tmp = Float64(x - Float64(y / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = a / (z - t);
	tmp = 0.0;
	if (y < -1.0761266216389975e-10)
		tmp = x - (1.0 / (t_1 / y));
	elseif (y < 2.894426862792089e-49)
		tmp = x - ((y * (z - t)) / a);
	else
		tmp = x - (y / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x - N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t_1}{y}}\\

\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024018 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
  :precision binary64

  :herbie-target
  (if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))

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