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

Percentage Accurate: 96.7% → 99.7%
Time: 13.9s
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: 96.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 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 96.9%

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

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

      \[\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-define99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y \cdot a}{t}\\ \mathbf{if}\;z \leq -9500000000000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-110}:\\ \;\;\;\;x + \frac{z}{\frac{t}{a}}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-245}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-262}:\\ \;\;\;\;\frac{y \cdot a}{-1 - t}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+51}:\\ \;\;\;\;x + \frac{y \cdot a}{z}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (/ (* y a) t))))
   (if (<= z -9500000000000.0)
     (- x a)
     (if (<= z -9e-110)
       (+ x (/ z (/ t a)))
       (if (<= z -1.3e-245)
         t_1
         (if (<= z 8e-262)
           (/ (* y a) (- -1.0 t))
           (if (<= z 7e-10)
             t_1
             (if (<= z 2.3e+51) (+ x (/ (* y a) z)) (- x a)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - ((y * a) / t);
	double tmp;
	if (z <= -9500000000000.0) {
		tmp = x - a;
	} else if (z <= -9e-110) {
		tmp = x + (z / (t / a));
	} else if (z <= -1.3e-245) {
		tmp = t_1;
	} else if (z <= 8e-262) {
		tmp = (y * a) / (-1.0 - t);
	} else if (z <= 7e-10) {
		tmp = t_1;
	} else if (z <= 2.3e+51) {
		tmp = x + ((y * a) / z);
	} 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 - ((y * a) / t)
    if (z <= (-9500000000000.0d0)) then
        tmp = x - a
    else if (z <= (-9d-110)) then
        tmp = x + (z / (t / a))
    else if (z <= (-1.3d-245)) then
        tmp = t_1
    else if (z <= 8d-262) then
        tmp = (y * a) / ((-1.0d0) - t)
    else if (z <= 7d-10) then
        tmp = t_1
    else if (z <= 2.3d+51) then
        tmp = x + ((y * a) / z)
    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 - ((y * a) / t);
	double tmp;
	if (z <= -9500000000000.0) {
		tmp = x - a;
	} else if (z <= -9e-110) {
		tmp = x + (z / (t / a));
	} else if (z <= -1.3e-245) {
		tmp = t_1;
	} else if (z <= 8e-262) {
		tmp = (y * a) / (-1.0 - t);
	} else if (z <= 7e-10) {
		tmp = t_1;
	} else if (z <= 2.3e+51) {
		tmp = x + ((y * a) / z);
	} else {
		tmp = x - a;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - ((y * a) / t)
	tmp = 0
	if z <= -9500000000000.0:
		tmp = x - a
	elif z <= -9e-110:
		tmp = x + (z / (t / a))
	elif z <= -1.3e-245:
		tmp = t_1
	elif z <= 8e-262:
		tmp = (y * a) / (-1.0 - t)
	elif z <= 7e-10:
		tmp = t_1
	elif z <= 2.3e+51:
		tmp = x + ((y * a) / z)
	else:
		tmp = x - a
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(Float64(y * a) / t))
	tmp = 0.0
	if (z <= -9500000000000.0)
		tmp = Float64(x - a);
	elseif (z <= -9e-110)
		tmp = Float64(x + Float64(z / Float64(t / a)));
	elseif (z <= -1.3e-245)
		tmp = t_1;
	elseif (z <= 8e-262)
		tmp = Float64(Float64(y * a) / Float64(-1.0 - t));
	elseif (z <= 7e-10)
		tmp = t_1;
	elseif (z <= 2.3e+51)
		tmp = Float64(x + Float64(Float64(y * a) / z));
	else
		tmp = Float64(x - a);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - ((y * a) / t);
	tmp = 0.0;
	if (z <= -9500000000000.0)
		tmp = x - a;
	elseif (z <= -9e-110)
		tmp = x + (z / (t / a));
	elseif (z <= -1.3e-245)
		tmp = t_1;
	elseif (z <= 8e-262)
		tmp = (y * a) / (-1.0 - t);
	elseif (z <= 7e-10)
		tmp = t_1;
	elseif (z <= 2.3e+51)
		tmp = x + ((y * a) / z);
	else
		tmp = x - a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(N[(y * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9500000000000.0], N[(x - a), $MachinePrecision], If[LessEqual[z, -9e-110], N[(x + N[(z / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.3e-245], t$95$1, If[LessEqual[z, 8e-262], N[(N[(y * a), $MachinePrecision] / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e-10], t$95$1, If[LessEqual[z, 2.3e+51], N[(x + N[(N[(y * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - a), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8 \cdot 10^{-262}:\\
\;\;\;\;\frac{y \cdot a}{-1 - t}\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+51}:\\
\;\;\;\;x + \frac{y \cdot a}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -9.5e12 or 2.30000000000000005e51 < z

    1. Initial program 94.1%

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

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

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

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

    if -9.5e12 < z < -9.0000000000000002e-110

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{z}{t}} + x \]
    8. Simplified72.7%

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

        \[\leadsto \color{blue}{\frac{a \cdot z}{t}} + x \]
      2. add-cube-cbrt72.5%

        \[\leadsto \frac{a \cdot z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      3. times-frac72.5%

        \[\leadsto \color{blue}{\frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}} + x \]
      4. add-sqr-sqrt0.0%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt[3]{t}} + x \]
      5. sqrt-unprod56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z \cdot z}}}{\sqrt[3]{t}} + x \]
      6. sqr-neg56.7%

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

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{\sqrt[3]{t}} + x \]
      8. add-sqr-sqrt56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{-z}}{\sqrt[3]{t}} + x \]
      9. times-frac56.7%

        \[\leadsto \color{blue}{\frac{a \cdot \left(-z\right)}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      10. *-commutative56.7%

        \[\leadsto \frac{\color{blue}{\left(-z\right) \cdot a}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}} + x \]
      11. add-cube-cbrt56.7%

        \[\leadsto \frac{\left(-z\right) \cdot a}{\color{blue}{t}} + x \]
      12. associate-/l*56.7%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{a}{t}} + x \]
      13. add-sqr-sqrt56.7%

        \[\leadsto \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \frac{a}{t} + x \]
      14. sqrt-unprod56.7%

        \[\leadsto \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \frac{a}{t} + x \]
      15. sqr-neg56.7%

        \[\leadsto \sqrt{\color{blue}{z \cdot z}} \cdot \frac{a}{t} + x \]
      16. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \frac{a}{t} + x \]
      17. add-sqr-sqrt76.5%

        \[\leadsto \color{blue}{z} \cdot \frac{a}{t} + x \]
      18. clear-num76.6%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{a}}} + x \]
      19. div-inv76.6%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{a}}} + x \]
    10. Applied egg-rr76.6%

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

    if -9.0000000000000002e-110 < z < -1.30000000000000003e-245 or 8.0000000000000001e-262 < z < 6.99999999999999961e-10

    1. Initial program 98.7%

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

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

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

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

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

    if -1.30000000000000003e-245 < z < 8.0000000000000001e-262

    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/100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(a \cdot y\right)}{1 + t}} \]
      2. neg-mul-159.6%

        \[\leadsto \frac{\color{blue}{-a \cdot y}}{1 + t} \]
      3. distribute-rgt-neg-in59.6%

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

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

    if 6.99999999999999961e-10 < z < 2.30000000000000005e51

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{-a \cdot y}}{z} \]
      3. distribute-rgt-neg-in82.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9500000000000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-110}:\\ \;\;\;\;x + \frac{z}{\frac{t}{a}}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-245}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-262}:\\ \;\;\;\;\frac{y \cdot a}{-1 - t}\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-10}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+51}:\\ \;\;\;\;x + \frac{y \cdot a}{z}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 71.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-245}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 4.6 \cdot 10^{-262}:\\
\;\;\;\;\frac{y \cdot a}{-1 - t}\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.8e10 or 1.05e-10 < z

    1. Initial program 94.8%

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

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

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

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

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

      \[\leadsto x - \color{blue}{\left(a + -1 \cdot \frac{a \cdot y}{z}\right)} \]
    7. Step-by-step derivation
      1. *-rgt-identity78.8%

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

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

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

        \[\leadsto x - \left(a \cdot 1 + \color{blue}{a \cdot \left(-\frac{y}{z}\right)}\right) \]
      5. distribute-lft-in90.1%

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

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

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

    if -7.8e10 < z < -8.0000000000000004e-110

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{z}{t}} + x \]
    8. Simplified72.7%

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

        \[\leadsto \color{blue}{\frac{a \cdot z}{t}} + x \]
      2. add-cube-cbrt72.5%

        \[\leadsto \frac{a \cdot z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      3. times-frac72.5%

        \[\leadsto \color{blue}{\frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}} + x \]
      4. add-sqr-sqrt0.0%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt[3]{t}} + x \]
      5. sqrt-unprod56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z \cdot z}}}{\sqrt[3]{t}} + x \]
      6. sqr-neg56.7%

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

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{\sqrt[3]{t}} + x \]
      8. add-sqr-sqrt56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{-z}}{\sqrt[3]{t}} + x \]
      9. times-frac56.7%

        \[\leadsto \color{blue}{\frac{a \cdot \left(-z\right)}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      10. *-commutative56.7%

        \[\leadsto \frac{\color{blue}{\left(-z\right) \cdot a}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}} + x \]
      11. add-cube-cbrt56.7%

        \[\leadsto \frac{\left(-z\right) \cdot a}{\color{blue}{t}} + x \]
      12. associate-/l*56.7%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{a}{t}} + x \]
      13. add-sqr-sqrt56.7%

        \[\leadsto \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \frac{a}{t} + x \]
      14. sqrt-unprod56.7%

        \[\leadsto \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \frac{a}{t} + x \]
      15. sqr-neg56.7%

        \[\leadsto \sqrt{\color{blue}{z \cdot z}} \cdot \frac{a}{t} + x \]
      16. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \frac{a}{t} + x \]
      17. add-sqr-sqrt76.5%

        \[\leadsto \color{blue}{z} \cdot \frac{a}{t} + x \]
      18. clear-num76.6%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{a}}} + x \]
      19. div-inv76.6%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{a}}} + x \]
    10. Applied egg-rr76.6%

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

    if -8.0000000000000004e-110 < z < -1.2e-245 or 4.6000000000000002e-262 < z < 1.05e-10

    1. Initial program 98.7%

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

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

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

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

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

    if -1.2e-245 < z < 4.6000000000000002e-262

    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/100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(a \cdot y\right)}{1 + t}} \]
      2. neg-mul-159.6%

        \[\leadsto \frac{\color{blue}{-a \cdot y}}{1 + t} \]
      3. distribute-rgt-neg-in59.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -78000000000:\\ \;\;\;\;x - a \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-110}:\\ \;\;\;\;x + \frac{z}{\frac{t}{a}}\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-245}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{-262}:\\ \;\;\;\;\frac{y \cdot a}{-1 - t}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-10}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 69.5% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.9e6 or 7.4999999999999999e50 < z

    1. Initial program 94.1%

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

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

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

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

    if -6.9e6 < z < -2.9000000000000001e-108

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{z}{t}} + x \]
    8. Simplified72.7%

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

        \[\leadsto \color{blue}{\frac{a \cdot z}{t}} + x \]
      2. add-cube-cbrt72.5%

        \[\leadsto \frac{a \cdot z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      3. times-frac72.5%

        \[\leadsto \color{blue}{\frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}} + x \]
      4. add-sqr-sqrt0.0%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt[3]{t}} + x \]
      5. sqrt-unprod56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z \cdot z}}}{\sqrt[3]{t}} + x \]
      6. sqr-neg56.7%

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

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{\sqrt[3]{t}} + x \]
      8. add-sqr-sqrt56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{-z}}{\sqrt[3]{t}} + x \]
      9. times-frac56.7%

        \[\leadsto \color{blue}{\frac{a \cdot \left(-z\right)}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      10. *-commutative56.7%

        \[\leadsto \frac{\color{blue}{\left(-z\right) \cdot a}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}} + x \]
      11. add-cube-cbrt56.7%

        \[\leadsto \frac{\left(-z\right) \cdot a}{\color{blue}{t}} + x \]
      12. associate-/l*56.7%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{a}{t}} + x \]
      13. add-sqr-sqrt56.7%

        \[\leadsto \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \frac{a}{t} + x \]
      14. sqrt-unprod56.7%

        \[\leadsto \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \frac{a}{t} + x \]
      15. sqr-neg56.7%

        \[\leadsto \sqrt{\color{blue}{z \cdot z}} \cdot \frac{a}{t} + x \]
      16. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \frac{a}{t} + x \]
      17. add-sqr-sqrt76.5%

        \[\leadsto \color{blue}{z} \cdot \frac{a}{t} + x \]
      18. clear-num76.6%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{a}}} + x \]
      19. div-inv76.6%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{a}}} + x \]
    10. Applied egg-rr76.6%

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

    if -2.9000000000000001e-108 < z < 3.3e-10

    1. Initial program 98.9%

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

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

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

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

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

    if 3.3e-10 < z < 7.4999999999999999e50

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto x - \frac{\color{blue}{-a \cdot y}}{z} \]
      3. distribute-rgt-neg-in82.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6900000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-108}:\\ \;\;\;\;x + \frac{z}{\frac{t}{a}}\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-10}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+50}:\\ \;\;\;\;x + \frac{y \cdot a}{z}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 69.4% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.96e12 or 1.05e-10 < z

    1. Initial program 94.8%

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

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

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

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

    if -1.96e12 < z < -5.1000000000000002e-108

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{z}{t}} + x \]
    8. Simplified72.7%

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

        \[\leadsto \color{blue}{\frac{a \cdot z}{t}} + x \]
      2. add-cube-cbrt72.5%

        \[\leadsto \frac{a \cdot z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      3. times-frac72.5%

        \[\leadsto \color{blue}{\frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}} + x \]
      4. add-sqr-sqrt0.0%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt[3]{t}} + x \]
      5. sqrt-unprod56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{z \cdot z}}}{\sqrt[3]{t}} + x \]
      6. sqr-neg56.7%

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

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}}{\sqrt[3]{t}} + x \]
      8. add-sqr-sqrt56.7%

        \[\leadsto \frac{a}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{\color{blue}{-z}}{\sqrt[3]{t}} + x \]
      9. times-frac56.7%

        \[\leadsto \color{blue}{\frac{a \cdot \left(-z\right)}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}} + x \]
      10. *-commutative56.7%

        \[\leadsto \frac{\color{blue}{\left(-z\right) \cdot a}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}} + x \]
      11. add-cube-cbrt56.7%

        \[\leadsto \frac{\left(-z\right) \cdot a}{\color{blue}{t}} + x \]
      12. associate-/l*56.7%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{a}{t}} + x \]
      13. add-sqr-sqrt56.7%

        \[\leadsto \color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \frac{a}{t} + x \]
      14. sqrt-unprod56.7%

        \[\leadsto \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \frac{a}{t} + x \]
      15. sqr-neg56.7%

        \[\leadsto \sqrt{\color{blue}{z \cdot z}} \cdot \frac{a}{t} + x \]
      16. sqrt-unprod0.0%

        \[\leadsto \color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \frac{a}{t} + x \]
      17. add-sqr-sqrt76.5%

        \[\leadsto \color{blue}{z} \cdot \frac{a}{t} + x \]
      18. clear-num76.6%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{a}}} + x \]
      19. div-inv76.6%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{a}}} + x \]
    10. Applied egg-rr76.6%

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

    if -5.1000000000000002e-108 < z < 1.05e-10

    1. Initial program 98.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1960000000000:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-108}:\\ \;\;\;\;x + \frac{z}{\frac{t}{a}}\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-10}:\\ \;\;\;\;x - \frac{y \cdot a}{t}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 92.1% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

    if -3.6999999999999999e37 < t < 8.4999999999999996e45

    1. Initial program 95.6%

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

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

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

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

    if 8.4999999999999996e45 < t

    1. Initial program 97.8%

      \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
    2. Step-by-step derivation
      1. associate-/r/99.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.5%

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

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

Alternative 7: 88.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8e9 or 1.05e-10 < z

    1. Initial program 94.8%

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

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

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

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

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

      \[\leadsto x - \color{blue}{\left(a + -1 \cdot \frac{a \cdot y}{z}\right)} \]
    7. Step-by-step derivation
      1. *-rgt-identity78.8%

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

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

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

        \[\leadsto x - \left(a \cdot 1 + \color{blue}{a \cdot \left(-\frac{y}{z}\right)}\right) \]
      5. distribute-lft-in90.1%

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

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

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

    if -3.8e9 < z < 1.05e-10

    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 z around 0 93.5%

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

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

Alternative 8: 65.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.8e11 or 3.7999999999999998e-10 < z

    1. Initial program 94.7%

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

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

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

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

    if -8.8e11 < z < 3.7999999999999998e-10

    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 t around inf 64.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \frac{z}{t}} + x \]
    8. Simplified55.0%

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

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

Alternative 9: 66.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -13200000 \lor \neg \left(z \leq 2.75 \cdot 10^{+29}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.32e7 or 2.75e29 < 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} \]
    3. Simplified100.0%

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

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

    if -1.32e7 < z < 2.75e29

    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. Taylor expanded in x around inf 53.2%

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

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

Alternative 10: 99.7% 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 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. Final simplification99.9%

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

Alternative 11: 54.2% 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 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 x around inf 51.7%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification51.7%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.7% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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