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

Percentage Accurate: 97.1% → 99.7%
Time: 10.6s
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.1% 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.7% 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 97.7%

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

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

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

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

Alternative 2: 86.6% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;z \leq 24000000000:\\
\;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2600000000000001e134 or 2.4e10 < z

    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 z around inf 87.8%

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

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

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

    if -1.2600000000000001e134 < z < -4.60000000000000018e-17

    1. Initial program 99.8%

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

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

    if -4.60000000000000018e-17 < z < 2.4e10

    1. Initial program 99.2%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.26 \cdot 10^{+134}:\\ \;\;\;\;x - a \cdot \frac{y - z}{-z}\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-17}:\\ \;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\ \mathbf{elif}\;z \leq 24000000000:\\ \;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \frac{y - z}{-z}\\ \end{array} \]

Alternative 3: 69.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{a}{\frac{t}{y}}\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+134}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-172}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+142}:\\ \;\;\;\;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 -1.4e+134)
     (- x a)
     (if (<= z -8.6e-257)
       t_1
       (if (<= z 3.1e-172) (- x (* y a)) (if (<= z 5.8e+142) 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 <= -1.4e+134) {
		tmp = x - a;
	} else if (z <= -8.6e-257) {
		tmp = t_1;
	} else if (z <= 3.1e-172) {
		tmp = x - (y * a);
	} else if (z <= 5.8e+142) {
		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 <= (-1.4d+134)) then
        tmp = x - a
    else if (z <= (-8.6d-257)) then
        tmp = t_1
    else if (z <= 3.1d-172) then
        tmp = x - (y * a)
    else if (z <= 5.8d+142) 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 <= -1.4e+134) {
		tmp = x - a;
	} else if (z <= -8.6e-257) {
		tmp = t_1;
	} else if (z <= 3.1e-172) {
		tmp = x - (y * a);
	} else if (z <= 5.8e+142) {
		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 <= -1.4e+134:
		tmp = x - a
	elif z <= -8.6e-257:
		tmp = t_1
	elif z <= 3.1e-172:
		tmp = x - (y * a)
	elif z <= 5.8e+142:
		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 <= -1.4e+134)
		tmp = Float64(x - a);
	elseif (z <= -8.6e-257)
		tmp = t_1;
	elseif (z <= 3.1e-172)
		tmp = Float64(x - Float64(y * a));
	elseif (z <= 5.8e+142)
		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 <= -1.4e+134)
		tmp = x - a;
	elseif (z <= -8.6e-257)
		tmp = t_1;
	elseif (z <= 3.1e-172)
		tmp = x - (y * a);
	elseif (z <= 5.8e+142)
		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, -1.4e+134], N[(x - a), $MachinePrecision], If[LessEqual[z, -8.6e-257], t$95$1, If[LessEqual[z, 3.1e-172], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+142], 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 -1.4 \cdot 10^{+134}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;z \leq -8.6 \cdot 10^{-257}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+142}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3999999999999999e134 or 5.80000000000000027e142 < z

    1. Initial program 93.4%

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

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

    if -1.3999999999999999e134 < z < -8.59999999999999995e-257 or 3.1000000000000003e-172 < z < 5.80000000000000027e142

    1. Initial program 99.2%

      \[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 z around 0 77.3%

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

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 + t}{y}}} \]
    6. Simplified81.9%

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

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

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

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

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

    if -8.59999999999999995e-257 < z < 3.1000000000000003e-172

    1. Initial program 99.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+134}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-257}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-172}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+142}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 4: 81.9% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3000000000000001e134 or 5.80000000000000027e142 < z

    1. Initial program 93.4%

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

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

    if -1.3000000000000001e134 < z < -6.9999999999999997e-18

    1. Initial program 99.8%

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

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

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

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

    if -6.9999999999999997e-18 < z < 5.80000000000000027e142

    1. Initial program 99.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+134}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-18}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y - z}}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+142}:\\ \;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 5: 81.9% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.54999999999999991e134 or 5.80000000000000027e142 < z

    1. Initial program 93.4%

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

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

    if -1.54999999999999991e134 < z < -6.9999999999999997e-18

    1. Initial program 99.8%

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

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

    if -6.9999999999999997e-18 < z < 5.80000000000000027e142

    1. Initial program 99.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+134}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-18}:\\ \;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+142}:\\ \;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 6: 88.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+135} \lor \neg \left(z \leq 1.25 \cdot 10^{+138}\right):\\
\;\;\;\;x - a \cdot \frac{y - z}{-z}\\

\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{\left(t + 1\right) - z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.69999999999999997e135 or 1.25000000000000004e138 < z

    1. Initial program 93.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 z around inf 93.3%

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

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

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

    if -3.69999999999999997e135 < z < 1.25000000000000004e138

    1. Initial program 99.4%

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

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

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

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

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

Alternative 7: 90.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -165000 \lor \neg \left(y \leq 68000000000000\right):\\
\;\;\;\;x - a \cdot \frac{y}{\left(t + 1\right) - z}\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{t - \left(z + -1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -165000 or 6.8e13 < y

    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.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 y around inf 89.6%

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

    if -165000 < y < 6.8e13

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 73.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -31 or 2.9499999999999999e-8 < t

    1. Initial program 97.3%

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

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

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

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

    if -31 < t < 2.9499999999999999e-8

    1. Initial program 98.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 t around 0 86.0%

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

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

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

Alternative 9: 71.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{a}{\frac{t}{z}}\\

\mathbf{elif}\;z \leq 1250000000:\\
\;\;\;\;x - y \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.99999999999999973e118 or 1.25e9 < z

    1. Initial program 95.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 -7.99999999999999973e118 < z < -8.5e-17

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{a \cdot z}{t} + x} \]
      5. associate-/l*65.2%

        \[\leadsto \color{blue}{\frac{a}{\frac{t}{z}}} + x \]
    7. Simplified65.2%

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

    if -8.5e-17 < z < 1.25e9

    1. Initial program 99.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+118}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-17}:\\ \;\;\;\;x + \frac{a}{\frac{t}{z}}\\ \mathbf{elif}\;z \leq 1250000000:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 10: 71.7% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq -7 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{z \cdot a}{t}\\

\mathbf{elif}\;z \leq 1500000000:\\
\;\;\;\;x - y \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.8e118 or 1.5e9 < z

    1. Initial program 95.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 -7.8e118 < z < -7.0000000000000003e-17

    1. Initial program 99.8%

      \[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. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

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

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

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

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

    if -7.0000000000000003e-17 < z < 1.5e9

    1. Initial program 99.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+118}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-17}:\\ \;\;\;\;x + \frac{z \cdot a}{t}\\ \mathbf{elif}\;z \leq 1500000000:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 11: 73.0% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;z \leq 4100000000:\\
\;\;\;\;x - y \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3e18 or 4.1e9 < z

    1. Initial program 95.8%

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

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

    if -3e18 < z < 4.1e9

    1. Initial program 99.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+18}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 4100000000:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 12: 66.1% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-11}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.7e11 or 3.19999999999999994e-11 < z

    1. Initial program 96.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 72.3%

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

    if -2.7e11 < z < 3.19999999999999994e-11

    1. Initial program 99.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -270000000000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 13: 55.1% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{-242}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 3.2 \cdot 10^{-169}:\\
\;\;\;\;-a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.4e-242 or 3.19999999999999995e-169 < x

    1. Initial program 99.5%

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

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

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

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

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

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

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

    if -5.4e-242 < x < 3.19999999999999995e-169

    1. Initial program 90.0%

      \[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 0 54.0%

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

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

        \[\leadsto x - \color{blue}{\frac{-1 \cdot \left(a \cdot z\right)}{1 - z}} \]
      2. associate-*r*28.1%

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

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

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

      \[\leadsto \color{blue}{\frac{a \cdot z}{1 - z}} \]
    9. Taylor expanded in z around inf 27.9%

      \[\leadsto \color{blue}{-1 \cdot a} \]
    10. Step-by-step derivation
      1. neg-mul-127.9%

        \[\leadsto \color{blue}{-a} \]
    11. Simplified27.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{-242}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-169}:\\ \;\;\;\;-a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 53.4% 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 97.7%

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

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

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

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

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

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

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

    \[\leadsto x \]

Developer target: 99.7% 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 2023224 
(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))))