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

Percentage Accurate: 97.0% → 99.6%
Time: 11.2s
Alternatives: 11
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 11 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.0% 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, 1.0× speedup?

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

\\
x + a \cdot \frac{y - z}{-1 + \left(z - t\right)}
\end{array}
Derivation
  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} \]
  3. Simplified99.9%

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

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

Alternative 2: 71.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 1.15 \cdot 10^{-75}:\\
\;\;\;\;x - y \cdot a\\

\mathbf{elif}\;t \leq 6.6 \cdot 10^{+80}:\\
\;\;\;\;x - a\\

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


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

    1. Initial program 97.3%

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

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

      \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
    5. Step-by-step derivation
      1. div-inv80.0%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{t}{a}}} \]
      2. clear-num80.0%

        \[\leadsto x - y \cdot \color{blue}{\frac{a}{t}} \]
    6. Applied egg-rr80.0%

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

    if -1 < t < 1.15e-75

    1. Initial program 98.2%

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

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

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

    if 1.15e-75 < t < 6.59999999999999982e80

    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} \]
    3. Simplified99.7%

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

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

    if 6.59999999999999982e80 < t

    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} \]
    3. Simplified99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-75}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{+80}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 71.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x - y \cdot \frac{a}{t}\\
\mathbf{if}\;t \leq -1:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-79}:\\
\;\;\;\;x - y \cdot a\\

\mathbf{elif}\;t \leq 2.05 \cdot 10^{+79}:\\
\;\;\;\;x - a\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 97.4%

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

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

      \[\leadsto x - \frac{\color{blue}{y}}{\frac{t}{a}} \]
    5. Step-by-step derivation
      1. div-inv79.8%

        \[\leadsto x - \color{blue}{y \cdot \frac{1}{\frac{t}{a}}} \]
      2. clear-num79.8%

        \[\leadsto x - y \cdot \color{blue}{\frac{a}{t}} \]
    6. Applied egg-rr79.8%

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

    if -1 < t < 2.40000000000000006e-79

    1. Initial program 98.2%

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

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

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

    if 2.40000000000000006e-79 < t < 2.05e79

    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} \]
    3. Simplified99.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-79}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{+79}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 90.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 97.4%

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

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

    if -3.99999999999999991e123 < t < 4.5000000000000003e25

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

    if 4.5000000000000003e25 < t

    1. Initial program 98.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{+123}:\\ \;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+25}:\\ \;\;\;\;x + \frac{a}{\frac{1 - z}{z - y}}\\ \mathbf{else}:\\ \;\;\;\;x + a \cdot \frac{z - y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 87.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.45e19 or 4.1999999999999997e-11 < z

    1. Initial program 96.7%

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

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

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

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

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

    if -1.45e19 < z < 4.1999999999999997e-11

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+19} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\ \;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 84.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+71} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.75e71 or 4.1999999999999997e-11 < 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} \]
    3. Simplified99.9%

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

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

    if -1.75e71 < z < 4.1999999999999997e-11

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+71} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 84.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+72} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2200000000000001e72 or 4.1999999999999997e-11 < 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} \]
    3. Simplified99.9%

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

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

    if -1.2200000000000001e72 < z < 4.1999999999999997e-11

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{a}{1 + t} \cdot y} \]
    9. Applied egg-rr86.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+72} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{a}{-1 - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 73.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+58} \lor \neg \left(z \leq 3.5 \cdot 10^{-14}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7499999999999999e58 or 3.5000000000000002e-14 < z

    1. Initial program 96.6%

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

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

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

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

    if -1.7499999999999999e58 < z < 3.5000000000000002e-14

    1. Initial program 99.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+58} \lor \neg \left(z \leq 3.5 \cdot 10^{-14}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot a\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0021 \lor \neg \left(z \leq 6.8 \cdot 10^{-15}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.00209999999999999987 or 6.8000000000000001e-15 < z

    1. Initial program 96.9%

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

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

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

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

    if -0.00209999999999999987 < z < 6.8000000000000001e-15

    1. Initial program 99.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0021 \lor \neg \left(z \leq 6.8 \cdot 10^{-15}\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 55.3% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-165}:\\
\;\;\;\;-a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.49999999999999986e-156 or 5.49999999999999969e-165 < x

    1. Initial program 99.4%

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

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

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

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

    if -4.49999999999999986e-156 < x < 5.49999999999999969e-165

    1. Initial program 93.2%

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

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

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

      \[\leadsto x - \color{blue}{a} \]
    6. Taylor expanded in x around 0 30.6%

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

        \[\leadsto \color{blue}{-a} \]
    8. Simplified30.6%

      \[\leadsto \color{blue}{-a} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 53.8% 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.0%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Add Preprocessing

Developer Target 1: 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 2024144 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

  :alt
  (! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))

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