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

Percentage Accurate: 93.3% → 97.1%
Time: 10.9s
Alternatives: 13
Speedup: 0.6×

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 13 alternatives:

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

Initial Program: 93.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - 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.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{-136}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.1999999999999999e-136

    1. Initial program 95.8%

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

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

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

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

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

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

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

    if 1.1999999999999999e-136 < y

    1. Initial program 93.9%

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

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

      \[\leadsto \color{blue}{x + y \cdot \frac{z - t}{a}} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification98.9%

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

Alternative 2: 67.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8.4 \cdot 10^{-191} \lor \neg \left(y \leq 2.8 \cdot 10^{-164} \lor \neg \left(y \leq 6 \cdot 10^{-149}\right) \land y \leq 3.5 \cdot 10^{-79}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= y -8.4e-191)
         (not (or (<= y 2.8e-164) (and (not (<= y 6e-149)) (<= y 3.5e-79)))))
   (* y (/ (- z t) a))
   x))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((y <= -8.4e-191) || !((y <= 2.8e-164) || (!(y <= 6e-149) && (y <= 3.5e-79)))) {
		tmp = y * ((z - t) / 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.4d-191)) .or. (.not. (y <= 2.8d-164) .or. (.not. (y <= 6d-149)) .and. (y <= 3.5d-79))) then
        tmp = y * ((z - t) / 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.4e-191) || !((y <= 2.8e-164) || (!(y <= 6e-149) && (y <= 3.5e-79)))) {
		tmp = y * ((z - t) / a);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (y <= -8.4e-191) or not ((y <= 2.8e-164) or (not (y <= 6e-149) and (y <= 3.5e-79))):
		tmp = y * ((z - t) / a)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((y <= -8.4e-191) || !((y <= 2.8e-164) || (!(y <= 6e-149) && (y <= 3.5e-79))))
		tmp = Float64(y * Float64(Float64(z - t) / a));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((y <= -8.4e-191) || ~(((y <= 2.8e-164) || (~((y <= 6e-149)) && (y <= 3.5e-79)))))
		tmp = y * ((z - t) / a);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -8.4e-191], N[Not[Or[LessEqual[y, 2.8e-164], And[N[Not[LessEqual[y, 6e-149]], $MachinePrecision], LessEqual[y, 3.5e-79]]]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{-191} \lor \neg \left(y \leq 2.8 \cdot 10^{-164} \lor \neg \left(y \leq 6 \cdot 10^{-149}\right) \land y \leq 3.5 \cdot 10^{-79}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.39999999999999941e-191 or 2.8000000000000001e-164 < y < 6.0000000000000003e-149 or 3.5000000000000003e-79 < y

    1. Initial program 93.0%

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a}} \]
    3. Simplified97.8%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + y \cdot \frac{z - t}{a \cdot x}\right)} \]
    8. Taylor expanded in x around 0 70.1%

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

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

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

    if -8.39999999999999941e-191 < y < 2.8000000000000001e-164 or 6.0000000000000003e-149 < y < 3.5000000000000003e-79

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.4 \cdot 10^{-191} \lor \neg \left(y \leq 2.8 \cdot 10^{-164} \lor \neg \left(y \leq 6 \cdot 10^{-149}\right) \land y \leq 3.5 \cdot 10^{-79}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 67.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{-190}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-164} \lor \neg \left(y \leq 2.3 \cdot 10^{-149}\right) \land y \leq 7 \cdot 10^{-80}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -1.15e-190)
   (* (- z t) (/ y a))
   (if (or (<= y 2.7e-164) (and (not (<= y 2.3e-149)) (<= y 7e-80)))
     x
     (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.15e-190) {
		tmp = (z - t) * (y / a);
	} else if ((y <= 2.7e-164) || (!(y <= 2.3e-149) && (y <= 7e-80))) {
		tmp = x;
	} else {
		tmp = y * ((z - 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.15d-190)) then
        tmp = (z - t) * (y / a)
    else if ((y <= 2.7d-164) .or. (.not. (y <= 2.3d-149)) .and. (y <= 7d-80)) then
        tmp = x
    else
        tmp = y * ((z - 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.15e-190) {
		tmp = (z - t) * (y / a);
	} else if ((y <= 2.7e-164) || (!(y <= 2.3e-149) && (y <= 7e-80))) {
		tmp = x;
	} else {
		tmp = y * ((z - t) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -1.15e-190:
		tmp = (z - t) * (y / a)
	elif (y <= 2.7e-164) or (not (y <= 2.3e-149) and (y <= 7e-80)):
		tmp = x
	else:
		tmp = y * ((z - t) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -1.15e-190)
		tmp = Float64(Float64(z - t) * Float64(y / a));
	elseif ((y <= 2.7e-164) || (!(y <= 2.3e-149) && (y <= 7e-80)))
		tmp = x;
	else
		tmp = Float64(y * Float64(Float64(z - t) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -1.15e-190)
		tmp = (z - t) * (y / a);
	elseif ((y <= 2.7e-164) || (~((y <= 2.3e-149)) && (y <= 7e-80)))
		tmp = x;
	else
		tmp = y * ((z - t) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.15e-190], N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 2.7e-164], And[N[Not[LessEqual[y, 2.3e-149]], $MachinePrecision], LessEqual[y, 7e-80]]], x, N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-190}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-164} \lor \neg \left(y \leq 2.3 \cdot 10^{-149}\right) \land y \leq 7 \cdot 10^{-80}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.14999999999999996e-190

    1. Initial program 92.7%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + y \cdot \frac{z - t}{a \cdot x}\right)} \]
    8. Taylor expanded in x around 0 64.0%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    10. Simplified68.1%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Taylor expanded in y around 0 64.0%

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

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

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

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

    if -1.14999999999999996e-190 < y < 2.7000000000000001e-164 or 2.3e-149 < y < 7.00000000000000029e-80

    1. Initial program 99.9%

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

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

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

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

    if 2.7000000000000001e-164 < y < 2.3e-149 or 7.00000000000000029e-80 < y

    1. Initial program 93.3%

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a}} \]
    3. Simplified98.8%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + y \cdot \frac{z - t}{a \cdot x}\right)} \]
    8. Taylor expanded in x around 0 76.7%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    10. Simplified81.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{-190}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-164} \lor \neg \left(y \leq 2.3 \cdot 10^{-149}\right) \land y \leq 7 \cdot 10^{-80}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 50.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.058:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\

\mathbf{elif}\;y \leq 28000000:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 10^{+129} \lor \neg \left(y \leq 1.52 \cdot 10^{+150}\right):\\
\;\;\;\;y \cdot \frac{-t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -0.0580000000000000029

    1. Initial program 87.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified62.8%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    12. Applied egg-rr62.8%

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

    if -0.0580000000000000029 < y < 2.8e7

    1. Initial program 99.8%

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

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

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

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

    if 2.8e7 < y < 1e129 or 1.52e150 < y

    1. Initial program 95.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot y\right)}{a}} \]
      2. neg-mul-163.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-y\right)} \]
    10. Simplified63.2%

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

    if 1e129 < y < 1.52e150

    1. Initial program 43.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified99.7%

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

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

Alternative 5: 50.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.052:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\

\mathbf{elif}\;y \leq 100000:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{+129}:\\
\;\;\;\;\frac{y}{\frac{a}{-t}}\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{+151}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -0.0519999999999999976

    1. Initial program 87.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified62.8%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    12. Applied egg-rr62.8%

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

    if -0.0519999999999999976 < y < 1e5

    1. Initial program 99.8%

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

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

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

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

    if 1e5 < y < 1.1999999999999999e129

    1. Initial program 96.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{a}} \]
    9. Step-by-step derivation
      1. mul-1-neg62.6%

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

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

        \[\leadsto -\color{blue}{\frac{y}{a} \cdot t} \]
      4. associate-/r/62.5%

        \[\leadsto -\color{blue}{\frac{y}{\frac{a}{t}}} \]
      5. distribute-neg-frac262.5%

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

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

    if 1.1999999999999999e129 < y < 1.20000000000000005e151

    1. Initial program 43.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified99.7%

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

    if 1.20000000000000005e151 < y

    1. Initial program 93.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot y\right)}{a}} \]
      2. neg-mul-163.7%

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

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-y\right)} \]
    10. Simplified64.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.052:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;y \leq 100000:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+129}:\\ \;\;\;\;\frac{y}{\frac{a}{-t}}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+151}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 50.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.225:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\

\mathbf{elif}\;y \leq 31000000000000:\\
\;\;\;\;x\\

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+149}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -0.225000000000000006

    1. Initial program 87.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified62.8%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    12. Applied egg-rr62.8%

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

    if -0.225000000000000006 < y < 3.1e13

    1. Initial program 99.8%

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

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

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

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

    if 3.1e13 < y < 4.7999999999999997e129

    1. Initial program 96.4%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + y \cdot \frac{z - t}{a \cdot x}\right)} \]
    8. Taylor expanded in x around 0 76.6%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Taylor expanded in z around 0 62.6%

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot y\right)}{a}} \]
      2. mul-1-neg62.6%

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a} \]
      3. distribute-lft-neg-out62.6%

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

        \[\leadsto \frac{\color{blue}{y \cdot \left(-t\right)}}{a} \]
    13. Simplified62.6%

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

    if 4.7999999999999997e129 < y < 4.49999999999999982e149

    1. Initial program 43.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified99.7%

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

    if 4.49999999999999982e149 < y

    1. Initial program 93.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot y\right)}{a}} \]
      2. neg-mul-163.7%

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

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

        \[\leadsto \color{blue}{\frac{t}{a} \cdot \left(-y\right)} \]
    10. Simplified64.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.225:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;y \leq 31000000000000:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+129}:\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+149}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{-t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 83.2% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.5999999999999999e-39 or 4.1000000000000003e206 < z

    1. Initial program 90.5%

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

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

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

      \[\leadsto \color{blue}{x + \frac{y \cdot z}{a}} \]
    6. Step-by-step derivation
      1. +-commutative82.9%

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
    7. Simplified81.5%

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

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a}{z}}} \]
      2. un-div-inv55.5%

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    11. Applied egg-rr88.5%

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

    if -1.5999999999999999e-39 < z < 36

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a}} \]
      5. *-commutative91.3%

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

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

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{a}} \]
    10. Simplified92.8%

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

    if 36 < z < 4.1000000000000003e206

    1. Initial program 93.9%

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a}} \]
    3. Simplified87.8%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + y \cdot \frac{z - t}{a \cdot x}\right)} \]
    8. Taylor expanded in x around 0 82.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    10. Simplified76.1%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Taylor expanded in y around 0 82.1%

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

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

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

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

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

Alternative 8: 82.5% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.54999999999999992e-44 or 3.7999999999999999e206 < z

    1. Initial program 90.6%

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a}} \]
    3. Simplified91.5%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
    7. Simplified81.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    11. Applied egg-rr88.7%

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

    if -1.54999999999999992e-44 < z < 0.0018

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

    if 0.0018 < z < 3.7999999999999999e206

    1. Initial program 93.9%

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{a}} \]
    3. Simplified87.8%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + y \cdot \frac{z - t}{a \cdot x}\right)} \]
    8. Taylor expanded in x around 0 82.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    10. Simplified76.1%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    11. Taylor expanded in y around 0 82.1%

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

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

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

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

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

Alternative 9: 93.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{-190} \lor \neg \left(y \leq 5 \cdot 10^{-208}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.15e-190 or 4.99999999999999963e-208 < y

    1. Initial program 93.9%

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

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

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

    if -2.15e-190 < y < 4.99999999999999963e-208

    1. Initial program 99.9%

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

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

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

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

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

Alternative 10: 78.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+50} \lor \neg \left(y \leq 23000000000000\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.8e50 or 2.3e13 < y

    1. Initial program 88.1%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z - t}{a}} \]
    10. Simplified86.0%

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

    if -5.8e50 < y < 2.3e13

    1. Initial program 99.8%

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

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

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

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

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

Alternative 11: 50.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.15 \lor \neg \left(y \leq 1.85 \cdot 10^{+111}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.149999999999999994 or 1.8500000000000001e111 < y

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

    if -0.149999999999999994 < y < 1.8500000000000001e111

    1. Initial program 99.3%

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

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

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

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

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

Alternative 12: 50.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0135:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{+111}:\\
\;\;\;\;x\\

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


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

    1. Initial program 87.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified62.8%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} \]
    12. Applied egg-rr62.8%

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

    if -0.0134999999999999998 < y < 2.09999999999999995e111

    1. Initial program 99.3%

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

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

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

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

    if 2.09999999999999995e111 < y

    1. Initial program 88.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} \]
    10. Simplified48.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0135:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+111}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 39.7% 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 95.1%

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

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

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

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

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.4% 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 2024066 
(FPCore (x y z t a)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
  :precision binary64

  :alt
  (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)))