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

Percentage Accurate: 93.8% → 97.3%
Time: 10.7s
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.8% 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.3% 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.1%

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

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

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

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

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

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

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

    \[\leadsto x + \frac{t - z}{\frac{a}{y}} \]

Alternative 2: 50.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \frac{y}{-a}\\ \mathbf{if}\;y \leq -2.05 \cdot 10^{+158}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.06 \cdot 10^{-73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+209}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* z (/ y (- a)))))
   (if (<= y -2.05e+158)
     (* t (/ y a))
     (if (<= y -1.06e-73)
       t_1
       (if (<= y 6.5e+14)
         x
         (if (<= y 1.95e+56)
           t_1
           (if (<= y 2.4e+169)
             (/ t (/ a y))
             (if (<= y 5.6e+209) t_1 (* y (/ t a))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = z * (y / -a);
	double tmp;
	if (y <= -2.05e+158) {
		tmp = t * (y / a);
	} else if (y <= -1.06e-73) {
		tmp = t_1;
	} else if (y <= 6.5e+14) {
		tmp = x;
	} else if (y <= 1.95e+56) {
		tmp = t_1;
	} else if (y <= 2.4e+169) {
		tmp = t / (a / y);
	} else if (y <= 5.6e+209) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = z * (y / -a)
    if (y <= (-2.05d+158)) then
        tmp = t * (y / a)
    else if (y <= (-1.06d-73)) then
        tmp = t_1
    else if (y <= 6.5d+14) then
        tmp = x
    else if (y <= 1.95d+56) then
        tmp = t_1
    else if (y <= 2.4d+169) then
        tmp = t / (a / y)
    else if (y <= 5.6d+209) then
        tmp = t_1
    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 t_1 = z * (y / -a);
	double tmp;
	if (y <= -2.05e+158) {
		tmp = t * (y / a);
	} else if (y <= -1.06e-73) {
		tmp = t_1;
	} else if (y <= 6.5e+14) {
		tmp = x;
	} else if (y <= 1.95e+56) {
		tmp = t_1;
	} else if (y <= 2.4e+169) {
		tmp = t / (a / y);
	} else if (y <= 5.6e+209) {
		tmp = t_1;
	} else {
		tmp = y * (t / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = z * (y / -a)
	tmp = 0
	if y <= -2.05e+158:
		tmp = t * (y / a)
	elif y <= -1.06e-73:
		tmp = t_1
	elif y <= 6.5e+14:
		tmp = x
	elif y <= 1.95e+56:
		tmp = t_1
	elif y <= 2.4e+169:
		tmp = t / (a / y)
	elif y <= 5.6e+209:
		tmp = t_1
	else:
		tmp = y * (t / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(z * Float64(y / Float64(-a)))
	tmp = 0.0
	if (y <= -2.05e+158)
		tmp = Float64(t * Float64(y / a));
	elseif (y <= -1.06e-73)
		tmp = t_1;
	elseif (y <= 6.5e+14)
		tmp = x;
	elseif (y <= 1.95e+56)
		tmp = t_1;
	elseif (y <= 2.4e+169)
		tmp = Float64(t / Float64(a / y));
	elseif (y <= 5.6e+209)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(t / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = z * (y / -a);
	tmp = 0.0;
	if (y <= -2.05e+158)
		tmp = t * (y / a);
	elseif (y <= -1.06e-73)
		tmp = t_1;
	elseif (y <= 6.5e+14)
		tmp = x;
	elseif (y <= 1.95e+56)
		tmp = t_1;
	elseif (y <= 2.4e+169)
		tmp = t / (a / y);
	elseif (y <= 5.6e+209)
		tmp = t_1;
	else
		tmp = y * (t / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.05e+158], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.06e-73], t$95$1, If[LessEqual[y, 6.5e+14], x, If[LessEqual[y, 1.95e+56], t$95$1, If[LessEqual[y, 2.4e+169], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e+209], t$95$1, N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.06 \cdot 10^{-73}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+14}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{+56}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq 5.6 \cdot 10^{+209}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg100.0%

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

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

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

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

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

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

    if -2.05000000000000002e158 < y < -1.05999999999999997e-73 or 6.5e14 < y < 1.94999999999999997e56 or 2.3999999999999998e169 < y < 5.60000000000000026e209

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-\color{blue}{1 \cdot \frac{y}{a}}\right) \]
      6. metadata-eval58.8%

        \[\leadsto z \cdot \left(-\color{blue}{\frac{-1}{-1}} \cdot \frac{y}{a}\right) \]
      7. times-frac58.8%

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

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

        \[\leadsto z \cdot \left(-\frac{-y}{\color{blue}{-a}}\right) \]
      10. distribute-frac-neg58.8%

        \[\leadsto z \cdot \color{blue}{\frac{-\left(-y\right)}{-a}} \]
      11. remove-double-neg58.8%

        \[\leadsto z \cdot \frac{\color{blue}{y}}{-a} \]
    6. Simplified58.8%

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

    if -1.05999999999999997e-73 < y < 6.5e14

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg96.7%

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

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

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

    if 1.94999999999999997e56 < y < 2.3999999999999998e169

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg95.8%

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

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

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

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

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

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

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

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

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

    if 5.60000000000000026e209 < y

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg95.7%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. *-commutative53.9%

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Taylor expanded in t around 0 53.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+158}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.06 \cdot 10^{-73}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+56}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+209}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 3: 50.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(-\frac{z}{a}\right)\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{+156}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-73}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+79}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+209}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (- (/ z a)))))
   (if (<= y -4.8e+156)
     (* t (/ y a))
     (if (<= y -1.7e-73)
       (* z (/ y (- a)))
       (if (<= y 1.06e+15)
         x
         (if (<= y 7e+79)
           t_1
           (if (<= y 2.4e+169)
             (/ t (/ a y))
             (if (<= y 1.15e+209) t_1 (* y (/ t a))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * -(z / a);
	double tmp;
	if (y <= -4.8e+156) {
		tmp = t * (y / a);
	} else if (y <= -1.7e-73) {
		tmp = z * (y / -a);
	} else if (y <= 1.06e+15) {
		tmp = x;
	} else if (y <= 7e+79) {
		tmp = t_1;
	} else if (y <= 2.4e+169) {
		tmp = t / (a / y);
	} else if (y <= 1.15e+209) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = y * -(z / a)
    if (y <= (-4.8d+156)) then
        tmp = t * (y / a)
    else if (y <= (-1.7d-73)) then
        tmp = z * (y / -a)
    else if (y <= 1.06d+15) then
        tmp = x
    else if (y <= 7d+79) then
        tmp = t_1
    else if (y <= 2.4d+169) then
        tmp = t / (a / y)
    else if (y <= 1.15d+209) then
        tmp = t_1
    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 t_1 = y * -(z / a);
	double tmp;
	if (y <= -4.8e+156) {
		tmp = t * (y / a);
	} else if (y <= -1.7e-73) {
		tmp = z * (y / -a);
	} else if (y <= 1.06e+15) {
		tmp = x;
	} else if (y <= 7e+79) {
		tmp = t_1;
	} else if (y <= 2.4e+169) {
		tmp = t / (a / y);
	} else if (y <= 1.15e+209) {
		tmp = t_1;
	} else {
		tmp = y * (t / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * -(z / a)
	tmp = 0
	if y <= -4.8e+156:
		tmp = t * (y / a)
	elif y <= -1.7e-73:
		tmp = z * (y / -a)
	elif y <= 1.06e+15:
		tmp = x
	elif y <= 7e+79:
		tmp = t_1
	elif y <= 2.4e+169:
		tmp = t / (a / y)
	elif y <= 1.15e+209:
		tmp = t_1
	else:
		tmp = y * (t / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(-Float64(z / a)))
	tmp = 0.0
	if (y <= -4.8e+156)
		tmp = Float64(t * Float64(y / a));
	elseif (y <= -1.7e-73)
		tmp = Float64(z * Float64(y / Float64(-a)));
	elseif (y <= 1.06e+15)
		tmp = x;
	elseif (y <= 7e+79)
		tmp = t_1;
	elseif (y <= 2.4e+169)
		tmp = Float64(t / Float64(a / y));
	elseif (y <= 1.15e+209)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(t / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * -(z / a);
	tmp = 0.0;
	if (y <= -4.8e+156)
		tmp = t * (y / a);
	elseif (y <= -1.7e-73)
		tmp = z * (y / -a);
	elseif (y <= 1.06e+15)
		tmp = x;
	elseif (y <= 7e+79)
		tmp = t_1;
	elseif (y <= 2.4e+169)
		tmp = t / (a / y);
	elseif (y <= 1.15e+209)
		tmp = t_1;
	else
		tmp = y * (t / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * (-N[(z / a), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[y, -4.8e+156], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.7e-73], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.06e+15], x, If[LessEqual[y, 7e+79], t$95$1, If[LessEqual[y, 2.4e+169], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+209], t$95$1, N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(-\frac{z}{a}\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{+156}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-73}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\

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

\mathbf{elif}\;y \leq 7 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+209}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -4.8000000000000002e156

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg100.0%

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

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

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

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

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

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

    if -4.8000000000000002e156 < y < -1.7000000000000001e-73

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7000000000000001e-73 < y < 1.06e15

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg96.7%

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

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

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

    if 1.06e15 < y < 6.99999999999999961e79 or 2.3999999999999998e169 < y < 1.15000000000000005e209

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg90.4%

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-\color{blue}{\frac{-1}{-1}} \cdot \frac{y}{a}\right) \]
      7. times-frac65.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{a}{y}}} \]
      4. distribute-frac-neg66.0%

        \[\leadsto \color{blue}{\frac{-z}{\frac{a}{y}}} \]
      5. associate-/r/71.8%

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

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

    if 6.99999999999999961e79 < y < 2.3999999999999998e169

    1. Initial program 65.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg99.7%

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified69.4%

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

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

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

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

    if 1.15000000000000005e209 < y

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg95.7%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. *-commutative53.9%

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Taylor expanded in t around 0 53.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+156}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-73}:\\ \;\;\;\;z \cdot \frac{y}{-a}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+79}:\\ \;\;\;\;y \cdot \left(-\frac{z}{a}\right)\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \left(-\frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 4: 50.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(-\frac{z}{a}\right)\\ \mathbf{if}\;y \leq -1.12 \cdot 10^{+157}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{-79}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+209}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (- (/ z a)))))
   (if (<= y -1.12e+157)
     (* t (/ y a))
     (if (<= y -4.1e-79)
       (/ (- z) (/ a y))
       (if (<= y 7e+14)
         x
         (if (<= y 2.1e+80)
           t_1
           (if (<= y 2.4e+169)
             (/ t (/ a y))
             (if (<= y 4.5e+209) t_1 (* y (/ t a))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * -(z / a);
	double tmp;
	if (y <= -1.12e+157) {
		tmp = t * (y / a);
	} else if (y <= -4.1e-79) {
		tmp = -z / (a / y);
	} else if (y <= 7e+14) {
		tmp = x;
	} else if (y <= 2.1e+80) {
		tmp = t_1;
	} else if (y <= 2.4e+169) {
		tmp = t / (a / y);
	} else if (y <= 4.5e+209) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = y * -(z / a)
    if (y <= (-1.12d+157)) then
        tmp = t * (y / a)
    else if (y <= (-4.1d-79)) then
        tmp = -z / (a / y)
    else if (y <= 7d+14) then
        tmp = x
    else if (y <= 2.1d+80) then
        tmp = t_1
    else if (y <= 2.4d+169) then
        tmp = t / (a / y)
    else if (y <= 4.5d+209) then
        tmp = t_1
    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 t_1 = y * -(z / a);
	double tmp;
	if (y <= -1.12e+157) {
		tmp = t * (y / a);
	} else if (y <= -4.1e-79) {
		tmp = -z / (a / y);
	} else if (y <= 7e+14) {
		tmp = x;
	} else if (y <= 2.1e+80) {
		tmp = t_1;
	} else if (y <= 2.4e+169) {
		tmp = t / (a / y);
	} else if (y <= 4.5e+209) {
		tmp = t_1;
	} else {
		tmp = y * (t / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * -(z / a)
	tmp = 0
	if y <= -1.12e+157:
		tmp = t * (y / a)
	elif y <= -4.1e-79:
		tmp = -z / (a / y)
	elif y <= 7e+14:
		tmp = x
	elif y <= 2.1e+80:
		tmp = t_1
	elif y <= 2.4e+169:
		tmp = t / (a / y)
	elif y <= 4.5e+209:
		tmp = t_1
	else:
		tmp = y * (t / a)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(-Float64(z / a)))
	tmp = 0.0
	if (y <= -1.12e+157)
		tmp = Float64(t * Float64(y / a));
	elseif (y <= -4.1e-79)
		tmp = Float64(Float64(-z) / Float64(a / y));
	elseif (y <= 7e+14)
		tmp = x;
	elseif (y <= 2.1e+80)
		tmp = t_1;
	elseif (y <= 2.4e+169)
		tmp = Float64(t / Float64(a / y));
	elseif (y <= 4.5e+209)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(t / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * -(z / a);
	tmp = 0.0;
	if (y <= -1.12e+157)
		tmp = t * (y / a);
	elseif (y <= -4.1e-79)
		tmp = -z / (a / y);
	elseif (y <= 7e+14)
		tmp = x;
	elseif (y <= 2.1e+80)
		tmp = t_1;
	elseif (y <= 2.4e+169)
		tmp = t / (a / y);
	elseif (y <= 4.5e+209)
		tmp = t_1;
	else
		tmp = y * (t / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * (-N[(z / a), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[y, -1.12e+157], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.1e-79], N[((-z) / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+14], x, If[LessEqual[y, 2.1e+80], t$95$1, If[LessEqual[y, 2.4e+169], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+209], t$95$1, N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.1 \cdot 10^{-79}:\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq 7 \cdot 10^{+14}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+209}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.11999999999999995e157

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg100.0%

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

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

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

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

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

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

    if -1.11999999999999995e157 < y < -4.09999999999999994e-79

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(\sqrt{\frac{y}{-a}} \cdot \sqrt{\frac{y}{-a}}\right)} \]
      2. sqrt-unprod26.8%

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

        \[\leadsto z \cdot \sqrt{\color{blue}{\frac{y \cdot y}{\left(-a\right) \cdot \left(-a\right)}}} \]
      4. sqr-neg24.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-z}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{y}} \]
      16. add-sqr-sqrt50.2%

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

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

    if -4.09999999999999994e-79 < y < 7e14

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg96.7%

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

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

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

    if 7e14 < y < 2.10000000000000001e80 or 2.3999999999999998e169 < y < 4.5000000000000003e209

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg90.4%

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(-\color{blue}{\frac{-1}{-1}} \cdot \frac{y}{a}\right) \]
      7. times-frac65.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{a}{y}}} \]
      4. distribute-frac-neg66.0%

        \[\leadsto \color{blue}{\frac{-z}{\frac{a}{y}}} \]
      5. associate-/r/71.8%

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

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

    if 2.10000000000000001e80 < y < 2.3999999999999998e169

    1. Initial program 65.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg99.7%

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    6. Simplified69.4%

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

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

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

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

    if 4.5000000000000003e209 < y

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg95.7%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot t}{a}} \]
    5. Step-by-step derivation
      1. *-commutative53.9%

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

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

      \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    7. Taylor expanded in t around 0 53.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{+157}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -4.1 \cdot 10^{-79}:\\ \;\;\;\;\frac{-z}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+80}:\\ \;\;\;\;y \cdot \left(-\frac{z}{a}\right)\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \left(-\frac{z}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 5: 49.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -8.8 \cdot 10^{+98}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq -1.7 \cdot 10^{-84} \lor \neg \left(y \leq 2.25 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

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


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

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.52e144 < y < -8.80000000000000034e98 or -1.7000000000000001e-84 < y < 2.25e15

    1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.80000000000000034e98 < y < -1.7000000000000001e-84 or 2.25e15 < y

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg96.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.52 \cdot 10^{+144}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;y \leq -8.8 \cdot 10^{+98}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq -1.7 \cdot 10^{-84} \lor \neg \left(y \leq 2.25 \cdot 10^{+15}\right):\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 82.8% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.3999999999999999e78

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg99.2%

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

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

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

    if -2.3999999999999999e78 < t < 5.6e10

    1. Initial program 93.2%

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

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

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

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

    if 5.6e10 < t

    1. Initial program 84.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+78}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{elif}\;t \leq 56000000000:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{-a}{t}}\\ \end{array} \]

Alternative 7: 67.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-156} \lor \neg \left(y \leq 5.5 \cdot 10^{+14}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.35000000000000006e-156 or 5.5e14 < y

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg97.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + -1 \cdot \frac{y \cdot z}{a} \]
      2. mul-1-neg64.6%

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

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

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

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

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

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

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

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

    if -1.35000000000000006e-156 < y < 5.5e14

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg97.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{-156} \lor \neg \left(y \leq 5.5 \cdot 10^{+14}\right):\\ \;\;\;\;y \cdot \frac{t - z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 8: 82.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+78} \lor \neg \left(t \leq 10000000000\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.3999999999999999e78 or 1e10 < t

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999999e78 < t < 1e10

    1. Initial program 93.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.4 \cdot 10^{+78} \lor \neg \left(t \leq 10000000000\right):\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \end{array} \]

Alternative 9: 69.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{+115}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.19999999999999925e115 or 5.40000000000000019e110 < a

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg95.7%

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

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

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

    if -8.19999999999999925e115 < a < 5.40000000000000019e110

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg97.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.2 \cdot 10^{+115}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 5.4 \cdot 10^{+110}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 77.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\

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


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

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e-58 < y < 1.45e15

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg96.8%

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

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

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

    if 1.45e15 < y

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg94.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot t} + -1 \cdot \frac{y \cdot z}{a} \]
      2. mul-1-neg63.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+15}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t - z}{a}\\ \end{array} \]

Alternative 11: 82.6% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.35000000000000011e79

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg99.2%

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

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

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

    if -2.35000000000000011e79 < t < 1.15e14

    1. Initial program 93.2%

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

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

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

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

    if 1.15e14 < t

    1. Initial program 84.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.35 \cdot 10^{+79}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+14}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 12: 50.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -600000000:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.9 \cdot 10^{+85}:\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6e8 or 1.89999999999999996e85 < a

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg96.8%

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

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

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

    if -6e8 < a < 1.89999999999999996e85

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
      10. remove-double-neg97.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -600000000:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{+85}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 93.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - y \cdot \frac{z - t}{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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

    \[\leadsto \color{blue}{x - y \cdot \frac{z - t}{a}} \]
  4. Final simplification94.8%

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

Alternative 14: 97.2% 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.1%

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

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

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

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

Alternative 15: 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 91.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{y}{a}, \color{blue}{\left(-\left(-t\right)\right) - z}, x\right) \]
    10. remove-double-neg97.2%

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification36.4%

    \[\leadsto x \]

Developer target: 99.2% accurate, 0.7× 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 2023185 
(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)))