Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3

Percentage Accurate: 97.2% → 99.6%
Time: 12.0s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{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 14 alternatives:

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

Initial Program: 97.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(a, \frac{z - y}{\left(t - z\right) + 1}, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma a (/ (- z y) (+ (- t z) 1.0)) x))
double code(double x, double y, double z, double t, double a) {
	return fma(a, ((z - y) / ((t - z) + 1.0)), x);
}
function code(x, y, z, t, a)
	return fma(a, Float64(Float64(z - y) / Float64(Float64(t - z) + 1.0)), x)
end
code[x_, y_, z_, t_, a_] := N[(a * N[(N[(z - y), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(a, \frac{z - y}{\left(t - z\right) + 1}, x\right)
\end{array}
Derivation
  1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(a, \frac{z - y}{\left(t - z\right) + 1}, x\right) \]

Alternative 2: 71.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -0.0085:\\
\;\;\;\;x + \frac{a \cdot y}{z}\\

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-198}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.1 \cdot 10^{-141}:\\
\;\;\;\;x - a \cdot y\\

\mathbf{elif}\;z \leq 9 \cdot 10^{+43}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.9999999999999998e110 or 9e43 < z

    1. Initial program 90.9%

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

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

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

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

    if -6.9999999999999998e110 < z < -0.0085000000000000006

    1. Initial program 92.0%

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

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

        \[\leadsto x - \frac{y - z}{\color{blue}{-\frac{z}{a}}} \]
      2. distribute-neg-frac69.7%

        \[\leadsto x - \frac{y - z}{\color{blue}{\frac{-z}{a}}} \]
    4. Simplified69.7%

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

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

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

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

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

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

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

    if -0.0085000000000000006 < z < -4.4999999999999998e-198 or 3.10000000000000027e-141 < z < 9e43

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -4.4999999999999998e-198 < z < 3.10000000000000027e-141

    1. Initial program 98.3%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 - z}{y - z}}} \]
    6. Simplified74.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+110}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -0.0085:\\ \;\;\;\;x + \frac{a \cdot y}{z}\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-198}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-141}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+43}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 3: 87.5% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq -6.2 \cdot 10^{+14} \lor \neg \left(z \leq 3.3 \cdot 10^{+19}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.92000000000000002e74 or -3.79999999999999971e29 < z < -6.2e14 or 3.3e19 < z

    1. Initial program 91.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Taylor expanded in z around inf 81.9%

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

        \[\leadsto x - \frac{y - z}{\color{blue}{-\frac{z}{a}}} \]
      2. distribute-neg-frac81.9%

        \[\leadsto x - \frac{y - z}{\color{blue}{\frac{-z}{a}}} \]
    4. Simplified81.9%

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

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

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

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

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

        \[\leadsto x - \left(a - \color{blue}{\frac{y}{\frac{z}{a}}}\right) \]
      5. associate-/r/89.8%

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

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

    if -1.92000000000000002e74 < z < -3.79999999999999971e29

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\left(-\frac{z}{\left(1 + t\right) - z} \cdot a\right)\right) + \left(-\frac{y}{\left(1 + t\right) - z} \cdot a\right)} \]
      8. remove-double-neg83.3%

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

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

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

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

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

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

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

    if -6.2e14 < z < 3.3e19

    1. Initial program 99.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.92 \cdot 10^{+74}:\\ \;\;\;\;x + \left(a \cdot \frac{y}{z} - a\right)\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+29}:\\ \;\;\;\;a \cdot \frac{z - y}{\left(t - z\right) + 1}\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{+14} \lor \neg \left(z \leq 3.3 \cdot 10^{+19}\right):\\ \;\;\;\;x + \left(a \cdot \frac{y}{z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \end{array} \]

Alternative 4: 72.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+113}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;z \leq -34:\\
\;\;\;\;x + \frac{a \cdot y}{z}\\

\mathbf{elif}\;z \leq -5.8 \cdot 10^{-188}:\\
\;\;\;\;x - \frac{a}{\frac{t}{y}}\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\
\;\;\;\;x - a \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -8.5000000000000001e113

    1. Initial program 94.0%

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

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

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

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

    if -8.5000000000000001e113 < z < -34

    1. Initial program 92.0%

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

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

        \[\leadsto x - \frac{y - z}{\color{blue}{-\frac{z}{a}}} \]
      2. distribute-neg-frac69.7%

        \[\leadsto x - \frac{y - z}{\color{blue}{\frac{-z}{a}}} \]
    4. Simplified69.7%

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

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

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

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

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

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

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

    if -34 < z < -5.8000000000000003e-188

    1. Initial program 99.6%

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

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

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

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

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

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

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

    if -5.8000000000000003e-188 < z < 2.74999999999999998e-58

    1. Initial program 98.6%

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

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

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

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

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

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

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

    if 2.74999999999999998e-58 < z

    1. Initial program 91.3%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 - z}{y - z}}} \]
    6. Simplified81.7%

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

      \[\leadsto \color{blue}{x - -1 \cdot \frac{a \cdot z}{1 - z}} \]
    8. Step-by-step derivation
      1. sub-neg65.2%

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

        \[\leadsto x + \left(-\color{blue}{\left(-\frac{a \cdot z}{1 - z}\right)}\right) \]
      3. remove-double-neg65.2%

        \[\leadsto x + \color{blue}{\frac{a \cdot z}{1 - z}} \]
      4. associate-/l*79.5%

        \[\leadsto x + \color{blue}{\frac{a}{\frac{1 - z}{z}}} \]
      5. div-sub79.5%

        \[\leadsto x + \frac{a}{\color{blue}{\frac{1}{z} - \frac{z}{z}}} \]
      6. sub-neg79.5%

        \[\leadsto x + \frac{a}{\color{blue}{\frac{1}{z} + \left(-\frac{z}{z}\right)}} \]
      7. *-inverses79.5%

        \[\leadsto x + \frac{a}{\frac{1}{z} + \left(-\color{blue}{1}\right)} \]
      8. metadata-eval79.5%

        \[\leadsto x + \frac{a}{\frac{1}{z} + \color{blue}{-1}} \]
    9. Simplified79.5%

      \[\leadsto \color{blue}{x + \frac{a}{\frac{1}{z} + -1}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification77.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+113}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -34:\\ \;\;\;\;x + \frac{a \cdot y}{z}\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-188}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{a}{\frac{1}{z} + -1}\\ \end{array} \]

Alternative 5: 82.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+110}:\\
\;\;\;\;x - a\\

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

\mathbf{elif}\;z \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;a \cdot \frac{z - y}{t}\\

\mathbf{elif}\;z \leq 6.6 \cdot 10^{+43}:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.49999999999999996e110 or 6.6000000000000003e43 < z

    1. Initial program 90.9%

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

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

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

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

    if -5.49999999999999996e110 < z < -7.5e73

    1. Initial program 90.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Taylor expanded in z around inf 90.2%

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

        \[\leadsto x - \frac{y - z}{\color{blue}{-\frac{z}{a}}} \]
      2. distribute-neg-frac90.2%

        \[\leadsto x - \frac{y - z}{\color{blue}{\frac{-z}{a}}} \]
    4. Simplified90.2%

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

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

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

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

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

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

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

    if -7.5e73 < z < -3.79999999999999971e29

    1. Initial program 89.9%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{t}{y - z}}} \]
    6. Simplified73.0%

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

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

      \[\leadsto \color{blue}{\left(\frac{z}{t} + -1 \cdot \frac{y}{t}\right)} \cdot a \]
    9. Step-by-step derivation
      1. neg-mul-153.1%

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

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

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

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

    if -3.79999999999999971e29 < z < 6.6000000000000003e43

    1. Initial program 99.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+110}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{+73}:\\ \;\;\;\;x + \frac{a \cdot y}{z}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{+29}:\\ \;\;\;\;a \cdot \frac{z - y}{t}\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+43}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 6: 70.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-199}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.28 \cdot 10^{-142}:\\
\;\;\;\;x - a \cdot y\\

\mathbf{elif}\;z \leq 4.1 \cdot 10^{+40}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.4999999999999997e124 or 4.1000000000000002e40 < z

    1. Initial program 90.8%

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

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

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

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

    if -8.4999999999999997e124 < z < -1.9500000000000001e-199 or 1.2799999999999999e-142 < z < 4.1000000000000002e40

    1. Initial program 97.6%

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

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

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

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

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

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

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

    if -1.9500000000000001e-199 < z < 1.2799999999999999e-142

    1. Initial program 98.3%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 - z}{y - z}}} \]
    6. Simplified74.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+124}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-199}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{-142}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+40}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 7: 91.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+48} \lor \neg \left(t \leq 2.8 \cdot 10^{+96}\right):\\
\;\;\;\;x - \frac{a}{\frac{t}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.20000000000000011e48 or 2.8e96 < t

    1. Initial program 95.4%

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

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

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

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

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

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

    if -6.20000000000000011e48 < t < 2.8e96

    1. Initial program 94.7%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 - z}{y - z}}} \]
    6. Simplified95.4%

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

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

Alternative 8: 88.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{+18} \lor \neg \left(z \leq 8.2 \cdot 10^{+19}\right):\\
\;\;\;\;x + \left(a \cdot \frac{y}{z} - a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.14e18 or 8.2e19 < z

    1. Initial program 91.2%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Taylor expanded in z around inf 78.5%

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

        \[\leadsto x - \frac{y - z}{\color{blue}{-\frac{z}{a}}} \]
      2. distribute-neg-frac78.5%

        \[\leadsto x - \frac{y - z}{\color{blue}{\frac{-z}{a}}} \]
    4. Simplified78.5%

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

      \[\leadsto x - \color{blue}{\left(a + -1 \cdot \frac{a \cdot y}{z}\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg81.0%

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

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

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

        \[\leadsto x - \left(a - \color{blue}{\frac{y}{\frac{z}{a}}}\right) \]
      5. associate-/r/85.8%

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

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

    if -1.14e18 < z < 8.2e19

    1. Initial program 99.0%

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

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

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

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

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

Alternative 9: 99.6% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 10: 63.3% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+37}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;z \leq -4.4 \cdot 10^{-261}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-250}:\\
\;\;\;\;a \cdot \left(-y\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.49999999999999962e37 or 0.00820000000000000069 < z

    1. Initial program 91.1%

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

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

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

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

    if -4.49999999999999962e37 < z < -4.4000000000000003e-261 or 1.05e-250 < z < 0.00820000000000000069

    1. Initial program 98.9%

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

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

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

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

    if -4.4000000000000003e-261 < z < 1.05e-250

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{a}{1 - z} \cdot \left(y - z\right)} \]
      3. *-commutative59.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(a \cdot y\right)} \]
    11. Step-by-step derivation
      1. associate-*r*59.8%

        \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot y} \]
      2. mul-1-neg59.8%

        \[\leadsto \color{blue}{\left(-a\right)} \cdot y \]
    12. Simplified59.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+37}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-261}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-250}:\\ \;\;\;\;a \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 0.0082:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 11: 73.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+37} \lor \neg \left(z \leq 1.3 \cdot 10^{-7}\right):\\
\;\;\;\;x - a\\

\mathbf{else}:\\
\;\;\;\;x - a \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.00000000000000043e37 or 1.29999999999999999e-7 < z

    1. Initial program 91.2%

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

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

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

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

    if -6.00000000000000043e37 < z < 1.29999999999999999e-7

    1. Initial program 99.0%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 - z}{y - z}}} \]
    6. Simplified69.7%

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

      \[\leadsto x - \color{blue}{y \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+37} \lor \neg \left(z \leq 1.3 \cdot 10^{-7}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot y\\ \end{array} \]

Alternative 12: 65.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+37}:\\
\;\;\;\;x - a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.49999999999999962e37 or 0.049000000000000002 < z

    1. Initial program 91.1%

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

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

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

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

    if -4.49999999999999962e37 < z < 0.049000000000000002

    1. Initial program 99.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+37}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 0.049:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 13: 53.4% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{+60}:\\ \;\;\;\;-a\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+153}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -5.4e+60) (- a) (if (<= a 2.3e+153) x (- a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.4e+60) {
		tmp = -a;
	} else if (a <= 2.3e+153) {
		tmp = x;
	} else {
		tmp = -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 (a <= (-5.4d+60)) then
        tmp = -a
    else if (a <= 2.3d+153) then
        tmp = x
    else
        tmp = -a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.4e+60) {
		tmp = -a;
	} else if (a <= 2.3e+153) {
		tmp = x;
	} else {
		tmp = -a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -5.4e+60:
		tmp = -a
	elif a <= 2.3e+153:
		tmp = x
	else:
		tmp = -a
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -5.4e+60)
		tmp = Float64(-a);
	elseif (a <= 2.3e+153)
		tmp = x;
	else
		tmp = Float64(-a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -5.4e+60)
		tmp = -a;
	elseif (a <= 2.3e+153)
		tmp = x;
	else
		tmp = -a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.4e+60], (-a), If[LessEqual[a, 2.3e+153], x, (-a)]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.4 \cdot 10^{+60}:\\
\;\;\;\;-a\\

\mathbf{elif}\;a \leq 2.3 \cdot 10^{+153}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;-a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.3999999999999999e60 or 2.3000000000000001e153 < a

    1. Initial program 99.7%

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 - z}{y - z}}} \]
    6. Simplified58.3%

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

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

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

        \[\leadsto -\color{blue}{\frac{a}{1 - z} \cdot \left(y - z\right)} \]
      3. *-commutative54.8%

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(-\frac{a}{1 - z}\right)} \]
    10. Taylor expanded in z around inf 31.6%

      \[\leadsto \color{blue}{-1 \cdot a} \]
    11. Step-by-step derivation
      1. mul-1-neg31.6%

        \[\leadsto \color{blue}{-a} \]
    12. Simplified31.6%

      \[\leadsto \color{blue}{-a} \]

    if -5.3999999999999999e60 < a < 2.3000000000000001e153

    1. Initial program 92.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{+60}:\\ \;\;\;\;-a\\ \mathbf{elif}\;a \leq 2.3 \cdot 10^{+153}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-a\\ \end{array} \]

Alternative 14: 53.5% accurate, 13.0× speedup?

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023192 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (- x (* (/ (- y z) (+ (- t z) 1.0)) a))

  (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))