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

Percentage Accurate: 97.2% → 99.7%
Time: 9.0s
Alternatives: 10
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 10 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.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 98.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} \]
    2. *-commutative100.0%

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

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

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

Alternative 2: 73.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - a \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -1.6 \cdot 10^{+128}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -30000000:\\ \;\;\;\;x + a \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.85 \cdot 10^{-129}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-72}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* a (/ y t)))))
   (if (<= z -1.6e+128)
     (- x a)
     (if (<= z -30000000.0)
       (+ x (* a (/ y z)))
       (if (<= z -2.85e-129)
         t_1
         (if (<= z 4.6e-72)
           (- x (* a y))
           (if (<= z 1.66e+22) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (a * (y / t));
	double tmp;
	if (z <= -1.6e+128) {
		tmp = x - a;
	} else if (z <= -30000000.0) {
		tmp = x + (a * (y / z));
	} else if (z <= -2.85e-129) {
		tmp = t_1;
	} else if (z <= 4.6e-72) {
		tmp = x - (a * y);
	} else if (z <= 1.66e+22) {
		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 * (y / t))
    if (z <= (-1.6d+128)) then
        tmp = x - a
    else if (z <= (-30000000.0d0)) then
        tmp = x + (a * (y / z))
    else if (z <= (-2.85d-129)) then
        tmp = t_1
    else if (z <= 4.6d-72) then
        tmp = x - (a * y)
    else if (z <= 1.66d+22) 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 * (y / t));
	double tmp;
	if (z <= -1.6e+128) {
		tmp = x - a;
	} else if (z <= -30000000.0) {
		tmp = x + (a * (y / z));
	} else if (z <= -2.85e-129) {
		tmp = t_1;
	} else if (z <= 4.6e-72) {
		tmp = x - (a * y);
	} else if (z <= 1.66e+22) {
		tmp = t_1;
	} else {
		tmp = x - a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (a * (y / t))
	tmp = 0
	if z <= -1.6e+128:
		tmp = x - a
	elif z <= -30000000.0:
		tmp = x + (a * (y / z))
	elif z <= -2.85e-129:
		tmp = t_1
	elif z <= 4.6e-72:
		tmp = x - (a * y)
	elif z <= 1.66e+22:
		tmp = t_1
	else:
		tmp = x - a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(a * Float64(y / t)))
	tmp = 0.0
	if (z <= -1.6e+128)
		tmp = Float64(x - a);
	elseif (z <= -30000000.0)
		tmp = Float64(x + Float64(a * Float64(y / z)));
	elseif (z <= -2.85e-129)
		tmp = t_1;
	elseif (z <= 4.6e-72)
		tmp = Float64(x - Float64(a * y));
	elseif (z <= 1.66e+22)
		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 * (y / t));
	tmp = 0.0;
	if (z <= -1.6e+128)
		tmp = x - a;
	elseif (z <= -30000000.0)
		tmp = x + (a * (y / z));
	elseif (z <= -2.85e-129)
		tmp = t_1;
	elseif (z <= 4.6e-72)
		tmp = x - (a * y);
	elseif (z <= 1.66e+22)
		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[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+128], N[(x - a), $MachinePrecision], If[LessEqual[z, -30000000.0], N[(x + N[(a * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.85e-129], t$95$1, If[LessEqual[z, 4.6e-72], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.66e+22], t$95$1, N[(x - a), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -2.85 \cdot 10^{-129}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.66 \cdot 10^{+22}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.59999999999999993e128 or 1.66e22 < z

    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.9%

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

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

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

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

    if -1.59999999999999993e128 < z < -3e7

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e7 < z < -2.85e-129 or 4.59999999999999989e-72 < z < 1.66e22

    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.9%

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

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

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

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

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

    if -2.85e-129 < z < 4.59999999999999989e-72

    1. Initial program 99.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} \]
      2. *-commutative100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+128}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -30000000:\\ \;\;\;\;x + a \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -2.85 \cdot 10^{-129}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-72}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 1.66 \cdot 10^{+22}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 3: 78.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - a \cdot \frac{y}{t}\\ t_2 := x + a \cdot \left(\frac{y}{z} + -1\right)\\ \mathbf{if}\;z \leq -22000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-129}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-72}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* a (/ y t)))) (t_2 (+ x (* a (+ (/ y z) -1.0)))))
   (if (<= z -22000000.0)
     t_2
     (if (<= z -7.6e-129)
       t_1
       (if (<= z 1.75e-72) (- x (* a y)) (if (<= z 3.4e+14) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (a * (y / t));
	double t_2 = x + (a * ((y / z) + -1.0));
	double tmp;
	if (z <= -22000000.0) {
		tmp = t_2;
	} else if (z <= -7.6e-129) {
		tmp = t_1;
	} else if (z <= 1.75e-72) {
		tmp = x - (a * y);
	} else if (z <= 3.4e+14) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x - (a * (y / t))
    t_2 = x + (a * ((y / z) + (-1.0d0)))
    if (z <= (-22000000.0d0)) then
        tmp = t_2
    else if (z <= (-7.6d-129)) then
        tmp = t_1
    else if (z <= 1.75d-72) then
        tmp = x - (a * y)
    else if (z <= 3.4d+14) then
        tmp = t_1
    else
        tmp = t_2
    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 / t));
	double t_2 = x + (a * ((y / z) + -1.0));
	double tmp;
	if (z <= -22000000.0) {
		tmp = t_2;
	} else if (z <= -7.6e-129) {
		tmp = t_1;
	} else if (z <= 1.75e-72) {
		tmp = x - (a * y);
	} else if (z <= 3.4e+14) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (a * (y / t))
	t_2 = x + (a * ((y / z) + -1.0))
	tmp = 0
	if z <= -22000000.0:
		tmp = t_2
	elif z <= -7.6e-129:
		tmp = t_1
	elif z <= 1.75e-72:
		tmp = x - (a * y)
	elif z <= 3.4e+14:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(a * Float64(y / t)))
	t_2 = Float64(x + Float64(a * Float64(Float64(y / z) + -1.0)))
	tmp = 0.0
	if (z <= -22000000.0)
		tmp = t_2;
	elseif (z <= -7.6e-129)
		tmp = t_1;
	elseif (z <= 1.75e-72)
		tmp = Float64(x - Float64(a * y));
	elseif (z <= 3.4e+14)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (a * (y / t));
	t_2 = x + (a * ((y / z) + -1.0));
	tmp = 0.0;
	if (z <= -22000000.0)
		tmp = t_2;
	elseif (z <= -7.6e-129)
		tmp = t_1;
	elseif (z <= 1.75e-72)
		tmp = x - (a * y);
	elseif (z <= 3.4e+14)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(a * N[(N[(y / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -22000000.0], t$95$2, If[LessEqual[z, -7.6e-129], t$95$1, If[LessEqual[z, 1.75e-72], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+14], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
t_2 := x + a \cdot \left(\frac{y}{z} + -1\right)\\
\mathbf{if}\;z \leq -22000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -7.6 \cdot 10^{-129}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+14}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.2e7 or 3.4e14 < z

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

    if -2.2e7 < z < -7.59999999999999969e-129 or 1.75e-72 < z < 3.4e14

    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.9%

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

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

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

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

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

    if -7.59999999999999969e-129 < z < 1.75e-72

    1. Initial program 99.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} \]
      2. *-commutative100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -22000000:\\ \;\;\;\;x + a \cdot \left(\frac{y}{z} + -1\right)\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-129}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-72}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+14}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \left(\frac{y}{z} + -1\right)\\ \end{array} \]

Alternative 4: 73.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - a \cdot \frac{y}{t}\\ \mathbf{if}\;z \leq -4.3 \cdot 10^{+38}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-128}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-74}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+22}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* a (/ y t)))))
   (if (<= z -4.3e+38)
     (- x a)
     (if (<= z -3.6e-128)
       t_1
       (if (<= z 6.5e-74) (- x (* a y)) (if (<= z 3e+22) t_1 (- x a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (a * (y / t));
	double tmp;
	if (z <= -4.3e+38) {
		tmp = x - a;
	} else if (z <= -3.6e-128) {
		tmp = t_1;
	} else if (z <= 6.5e-74) {
		tmp = x - (a * y);
	} else if (z <= 3e+22) {
		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 * (y / t))
    if (z <= (-4.3d+38)) then
        tmp = x - a
    else if (z <= (-3.6d-128)) then
        tmp = t_1
    else if (z <= 6.5d-74) then
        tmp = x - (a * y)
    else if (z <= 3d+22) 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 * (y / t));
	double tmp;
	if (z <= -4.3e+38) {
		tmp = x - a;
	} else if (z <= -3.6e-128) {
		tmp = t_1;
	} else if (z <= 6.5e-74) {
		tmp = x - (a * y);
	} else if (z <= 3e+22) {
		tmp = t_1;
	} else {
		tmp = x - a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (a * (y / t))
	tmp = 0
	if z <= -4.3e+38:
		tmp = x - a
	elif z <= -3.6e-128:
		tmp = t_1
	elif z <= 6.5e-74:
		tmp = x - (a * y)
	elif z <= 3e+22:
		tmp = t_1
	else:
		tmp = x - a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(a * Float64(y / t)))
	tmp = 0.0
	if (z <= -4.3e+38)
		tmp = Float64(x - a);
	elseif (z <= -3.6e-128)
		tmp = t_1;
	elseif (z <= 6.5e-74)
		tmp = Float64(x - Float64(a * y));
	elseif (z <= 3e+22)
		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 * (y / t));
	tmp = 0.0;
	if (z <= -4.3e+38)
		tmp = x - a;
	elseif (z <= -3.6e-128)
		tmp = t_1;
	elseif (z <= 6.5e-74)
		tmp = x - (a * y);
	elseif (z <= 3e+22)
		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[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+38], N[(x - a), $MachinePrecision], If[LessEqual[z, -3.6e-128], t$95$1, If[LessEqual[z, 6.5e-74], N[(x - N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+22], t$95$1, N[(x - a), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-128}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 3 \cdot 10^{+22}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.2999999999999997e38 or 3e22 < z

    1. Initial program 97.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} \]
      2. *-commutative99.9%

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

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

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

    if -4.2999999999999997e38 < z < -3.60000000000000025e-128 or 6.5000000000000002e-74 < z < 3e22

    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.9%

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

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

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

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

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

    if -3.60000000000000025e-128 < z < 6.5000000000000002e-74

    1. Initial program 99.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} \]
      2. *-commutative100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+38}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-128}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-74}:\\ \;\;\;\;x - a \cdot y\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+22}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 5: 90.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -35000000:\\
\;\;\;\;x - a \cdot \frac{y}{t + 1}\\

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

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


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

    1. Initial program 98.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} \]
      2. *-commutative100.0%

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

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

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

    if -3.5e7 < t < 6.80000000000000024e43

    1. Initial program 98.5%

      \[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} \]
      2. *-commutative99.9%

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

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

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

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

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

    if 6.80000000000000024e43 < t

    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} \]
      2. *-commutative99.9%

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

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

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

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

Alternative 6: 89.2% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1e7 or 3.9e14 < z

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

    if -1e7 < z < 3.9e14

    1. Initial program 99.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} \]
      2. *-commutative100.0%

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

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

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

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

Alternative 7: 73.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-20}:\\
\;\;\;\;x - a\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.49999999999999981e-20 or 6.1e13 < z

    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} \]
      2. *-commutative99.9%

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

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

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

    if -7.49999999999999981e-20 < z < 6.1e13

    1. Initial program 99.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} \]
      2. *-commutative100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{-20}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 61000000000000:\\ \;\;\;\;x - a \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 8: 66.6% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;z \leq 4.3 \cdot 10^{+14}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.5e50 or 4.3e14 < z

    1. Initial program 97.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} \]
      2. *-commutative99.9%

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

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

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

    if -2.5e50 < z < 4.3e14

    1. Initial program 99.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} \]
      2. *-commutative100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+50}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 9: 54.7% accurate, 3.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.35 \cdot 10^{+126}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.35000000000000001e126

    1. Initial program 98.5%

      \[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} \]
      2. *-commutative99.9%

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

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

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

    if 1.35000000000000001e126 < a

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot a} \]
    9. Step-by-step derivation
      1. mul-1-neg30.5%

        \[\leadsto \color{blue}{-a} \]
    10. Simplified30.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.35 \cdot 10^{+126}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-a\\ \end{array} \]

Alternative 10: 54.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 98.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} \]
    2. *-commutative100.0%

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification50.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 2023271 
(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))))