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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 97.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 72.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + a \cdot \left(z - y\right)\\ t_2 := x - y \cdot \frac{a}{t}\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{+70}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{-40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-235}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* a (- z y)))) (t_2 (- x (* y (/ a t)))))
   (if (<= z -7.2e+70)
     (- x a)
     (if (<= z -1.75e-40)
       t_2
       (if (<= z -1.85e-202)
         t_1
         (if (<= z -7.8e-235) t_2 (if (<= z 4.8e-43) t_1 (- x a))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (a * (z - y));
	double t_2 = x - (y * (a / t));
	double tmp;
	if (z <= -7.2e+70) {
		tmp = x - a;
	} else if (z <= -1.75e-40) {
		tmp = t_2;
	} else if (z <= -1.85e-202) {
		tmp = t_1;
	} else if (z <= -7.8e-235) {
		tmp = t_2;
	} else if (z <= 4.8e-43) {
		tmp = t_1;
	} else {
		tmp = x - a;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (a * (z - y))
    t_2 = x - (y * (a / t))
    if (z <= (-7.2d+70)) then
        tmp = x - a
    else if (z <= (-1.75d-40)) then
        tmp = t_2
    else if (z <= (-1.85d-202)) then
        tmp = t_1
    else if (z <= (-7.8d-235)) then
        tmp = t_2
    else if (z <= 4.8d-43) then
        tmp = t_1
    else
        tmp = x - a
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (a * (z - y));
	double t_2 = x - (y * (a / t));
	double tmp;
	if (z <= -7.2e+70) {
		tmp = x - a;
	} else if (z <= -1.75e-40) {
		tmp = t_2;
	} else if (z <= -1.85e-202) {
		tmp = t_1;
	} else if (z <= -7.8e-235) {
		tmp = t_2;
	} else if (z <= 4.8e-43) {
		tmp = t_1;
	} else {
		tmp = x - a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (a * (z - y))
	t_2 = x - (y * (a / t))
	tmp = 0
	if z <= -7.2e+70:
		tmp = x - a
	elif z <= -1.75e-40:
		tmp = t_2
	elif z <= -1.85e-202:
		tmp = t_1
	elif z <= -7.8e-235:
		tmp = t_2
	elif z <= 4.8e-43:
		tmp = t_1
	else:
		tmp = x - a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(a * Float64(z - y)))
	t_2 = Float64(x - Float64(y * Float64(a / t)))
	tmp = 0.0
	if (z <= -7.2e+70)
		tmp = Float64(x - a);
	elseif (z <= -1.75e-40)
		tmp = t_2;
	elseif (z <= -1.85e-202)
		tmp = t_1;
	elseif (z <= -7.8e-235)
		tmp = t_2;
	elseif (z <= 4.8e-43)
		tmp = t_1;
	else
		tmp = Float64(x - a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (a * (z - y));
	t_2 = x - (y * (a / t));
	tmp = 0.0;
	if (z <= -7.2e+70)
		tmp = x - a;
	elseif (z <= -1.75e-40)
		tmp = t_2;
	elseif (z <= -1.85e-202)
		tmp = t_1;
	elseif (z <= -7.8e-235)
		tmp = t_2;
	elseif (z <= 4.8e-43)
		tmp = t_1;
	else
		tmp = x - a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(a * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+70], N[(x - a), $MachinePrecision], If[LessEqual[z, -1.75e-40], t$95$2, If[LessEqual[z, -1.85e-202], t$95$1, If[LessEqual[z, -7.8e-235], t$95$2, If[LessEqual[z, 4.8e-43], t$95$1, N[(x - a), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.75 \cdot 10^{-40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{-202}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.8 \cdot 10^{-235}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-43}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.1999999999999999e70 or 4.8000000000000004e-43 < z

    1. Initial program 96.3%

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

        \[\leadsto x - \color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
      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 -7.1999999999999999e70 < z < -1.7500000000000001e-40 or -1.84999999999999995e-202 < z < -7.79999999999999939e-235

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{t}} \]
    9. Simplified85.0%

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

    if -1.7500000000000001e-40 < z < -1.84999999999999995e-202 or -7.79999999999999939e-235 < z < 4.8000000000000004e-43

    1. Initial program 99.8%

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

      \[\leadsto x - \frac{y - z}{\color{blue}{\frac{1 + t}{a}}} \]
    3. Taylor expanded in t around 0 83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+70}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -1.75 \cdot 10^{-40}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-202}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-235}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-43}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 3: 72.8% accurate, 0.8× speedup?

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

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

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

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

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

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-43}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.5499999999999999e69 or 4.8000000000000004e-43 < z

    1. Initial program 96.3%

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

        \[\leadsto x - \color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
      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.5499999999999999e69 < z < -3.29999999999999985e-39

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -3.29999999999999985e-39 < z < -4.50000000000000039e-202 or -1.69999999999999986e-235 < z < 4.8000000000000004e-43

    1. Initial program 99.8%

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

      \[\leadsto x - \frac{y - z}{\color{blue}{\frac{1 + t}{a}}} \]
    3. Taylor expanded in t around 0 83.6%

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

    if -4.50000000000000039e-202 < z < -1.69999999999999986e-235

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{t}} \]
    9. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+69}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-39}:\\ \;\;\;\;x - \frac{a}{\frac{t}{y}}\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-202}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-235}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-43}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 4: 91.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -17000000 \lor \neg \left(z \leq 5.9 \cdot 10^{+78}\right):\\
\;\;\;\;x - \frac{a}{\frac{1 - z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e7 or 5.9e78 < 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} \]
      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 71.4%

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

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

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

    if -1.7e7 < z < 5.9e78

    1. Initial program 99.8%

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

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

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

Alternative 5: 89.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

        \[\leadsto x - \color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
      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 80.1%

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

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

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

    if -3.6e18 < t < 5.49999999999999966e27

    1. Initial program 98.3%

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

        \[\leadsto x - \color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
      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 87.9%

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

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

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

    if 5.49999999999999966e27 < t

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.5% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9999999999999999e74 or 1.01999999999999999e-4 < z

    1. Initial program 96.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} \]
      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 82.3%

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

    if -1.9999999999999999e74 < z < 1.01999999999999999e-4

    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 91.2%

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

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

Alternative 7: 85.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 98.0%

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

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

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

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

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

    if -4.6e7 < z < 1.01999999999999999e-4

    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 93.1%

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

    if 1.01999999999999999e-4 < z

    1. Initial program 94.2%

      \[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 inf 83.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -46000000:\\ \;\;\;\;x + \frac{z - y}{\frac{-z}{a}}\\ \mathbf{elif}\;z \leq 0.000102:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 8: 99.6% accurate, 1.0× speedup?

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

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

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

      \[\leadsto x - \color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
    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. Final simplification99.9%

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

Alternative 9: 72.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-43}:\\
\;\;\;\;x + a \cdot \left(z - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.06e54 or 4.8000000000000004e-43 < z

    1. Initial program 96.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} \]
      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.4%

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

    if -1.06e54 < z < 4.8000000000000004e-43

    1. Initial program 99.8%

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

      \[\leadsto x - \frac{y - z}{\color{blue}{\frac{1 + t}{a}}} \]
    3. Taylor expanded in t around 0 76.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.06 \cdot 10^{+54}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-43}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 10: 65.0% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-52}:\\
\;\;\;\;x + z \cdot a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2500000000000002e-9 or 1.9000000000000002e-52 < z

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

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

    if -3.2500000000000002e-9 < z < 1.9000000000000002e-52

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{1 - z}}, a, x\right) \]
    6. Taylor expanded in z around 0 59.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.25 \cdot 10^{-9}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-52}:\\ \;\;\;\;x + z \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]

Alternative 11: 72.1% accurate, 1.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.09999999999999995e54 or 1.01999999999999999e-4 < 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} \]
      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.09999999999999995e54 < z < 1.01999999999999999e-4

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-a \cdot y\right)} + x \]
      2. distribute-lft-neg-out72.4%

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

        \[\leadsto \color{blue}{x + \left(-a\right) \cdot y} \]
      4. distribute-lft-neg-out72.4%

        \[\leadsto x + \color{blue}{\left(-a \cdot y\right)} \]
      5. unsub-neg72.4%

        \[\leadsto \color{blue}{x - a \cdot y} \]
      6. *-commutative72.4%

        \[\leadsto x - \color{blue}{y \cdot a} \]
    7. Applied egg-rr72.4%

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

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

Alternative 12: 65.0% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.75e-9 or 2.05e8 < z

    1. Initial program 96.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} \]
      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 78.9%

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

    if -1.75e-9 < z < 2.05e8

    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 x around inf 60.0%

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

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

Alternative 13: 53.0% accurate, 3.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.99999999999999969e135

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-a} \]
    9. Simplified36.4%

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

    if -7.99999999999999969e135 < a

    1. Initial program 98.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} \]
      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 67.1%

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

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

Alternative 14: 52.6% 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.3%

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

      \[\leadsto x - \color{blue}{\frac{y - z}{\left(t - z\right) + 1} \cdot a} \]
    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 58.3%

    \[\leadsto \color{blue}{x} \]
  5. Final simplification58.3%

    \[\leadsto x \]

Developer target: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2023279 
(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))))