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

Percentage Accurate: 97.2% → 99.6%
Time: 16.2s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 97.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 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}
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.6%

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

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

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

Alternative 2: 82.5% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{-34}:\\
\;\;\;\;x + z \cdot \frac{a}{t + 1}\\

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

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+95}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+95}:\\
\;\;\;\;a \cdot \frac{-y}{t}\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.50000000000000023e24 or 2.20000000000000007e105 < z

    1. Initial program 93.3%

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

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

    if -2.50000000000000023e24 < z < 9.5000000000000003e-126

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

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

    if 9.5000000000000003e-126 < z < 3.60000000000000008e-34

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - z \cdot \frac{\color{blue}{-a}}{1 + t} \]
    10. Simplified91.2%

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

    if 3.60000000000000008e-34 < z < 0.045999999999999999

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{1 + t}} \]
    7. Simplified90.3%

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

    if 0.045999999999999999 < z < 1.49999999999999996e95 or 4.3999999999999998e95 < z < 2.20000000000000007e105

    1. Initial program 99.9%

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

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

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

    if 1.49999999999999996e95 < z < 4.3999999999999998e95

    1. Initial program 98.4%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(a \cdot y\right)}{t}} \]
      2. *-commutative53.0%

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

        \[\leadsto \frac{\color{blue}{-y \cdot a}}{t} \]
      4. distribute-lft-neg-in53.0%

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot a}}{t} \]
    6. Simplified53.0%

      \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot a}{t}} \]
    7. Taylor expanded in y around 0 53.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{a \cdot y}{t}} \]
    8. Step-by-step derivation
      1. mul-1-neg53.0%

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

        \[\leadsto -\color{blue}{a \cdot \frac{y}{t}} \]
      3. distribute-rgt-neg-in100.0%

        \[\leadsto \color{blue}{a \cdot \left(-\frac{y}{t}\right)} \]
      4. distribute-frac-neg100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+24}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-126}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-34}:\\ \;\;\;\;x + z \cdot \frac{a}{t + 1}\\ \mathbf{elif}\;z \leq 0.046:\\ \;\;\;\;x + y \cdot \frac{a}{-1 - t}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+95}:\\ \;\;\;\;x - \frac{y \cdot a}{1 - z}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+95}:\\ \;\;\;\;a \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+105}:\\ \;\;\;\;x - \frac{y \cdot a}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 83.9% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+95}:\\
\;\;\;\;x - \frac{y \cdot a}{1 - z}\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{+95}:\\
\;\;\;\;a \cdot \frac{-y}{t}\\

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+161}:\\
\;\;\;\;x + \frac{z \cdot a}{1 - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.5999999999999999e24 or 4.5999999999999999e161 < z

    1. Initial program 92.5%

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

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

    if -1.5999999999999999e24 < z < 1

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

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

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

      \[\leadsto x - \color{blue}{\frac{y}{1 + t}} \cdot a \]
    6. Step-by-step derivation
      1. *-commutative87.2%

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

        \[\leadsto x - a \cdot \color{blue}{\frac{1}{\frac{1 + t}{y}}} \]
      3. un-div-inv87.2%

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 + t}{y}}} \]
      4. +-commutative87.2%

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

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

    if 1 < z < 1.49999999999999996e95

    1. Initial program 100.0%

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

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

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

    if 1.49999999999999996e95 < z < 4.3999999999999998e95

    1. Initial program 98.4%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(a \cdot y\right)}{t}} \]
      2. *-commutative53.0%

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

        \[\leadsto \frac{\color{blue}{-y \cdot a}}{t} \]
      4. distribute-lft-neg-in53.0%

        \[\leadsto \frac{\color{blue}{\left(-y\right) \cdot a}}{t} \]
    6. Simplified53.0%

      \[\leadsto \color{blue}{\frac{\left(-y\right) \cdot a}{t}} \]
    7. Taylor expanded in y around 0 53.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{a \cdot y}{t}} \]
    8. Step-by-step derivation
      1. mul-1-neg53.0%

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

        \[\leadsto -\color{blue}{a \cdot \frac{y}{t}} \]
      3. distribute-rgt-neg-in100.0%

        \[\leadsto \color{blue}{a \cdot \left(-\frac{y}{t}\right)} \]
      4. distribute-frac-neg100.0%

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

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

    if 4.3999999999999998e95 < z < 4.5999999999999999e161

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+24}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;x - \frac{a}{\frac{t + 1}{y}}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+95}:\\ \;\;\;\;x - \frac{y \cdot a}{1 - z}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+95}:\\ \;\;\;\;a \cdot \frac{-y}{t}\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+161}:\\ \;\;\;\;x + \frac{z \cdot a}{1 - z}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.5% accurate, 0.4× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.5e18 or 5.49999999999999958e-31 < z

    1. Initial program 94.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 81.5%

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

    if -8.5e18 < z < -2.5000000000000001e-169 or -1.45000000000000011e-267 < z < 6.5000000000000005e-225

    1. Initial program 98.2%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{t}} \]
    8. Simplified79.8%

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

    if -2.5000000000000001e-169 < z < -1.45000000000000011e-267 or 6.5000000000000005e-225 < z < 5.49999999999999958e-31

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot a} \]
    8. Simplified75.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+18}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-169}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-267}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-225}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-31}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.6% accurate, 0.4× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.25e17 or 5.49999999999999958e-31 < z

    1. Initial program 94.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 81.5%

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

    if -1.25e17 < z < -1.19999999999999997e-167

    1. Initial program 97.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 0 85.3%

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

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

    if -1.19999999999999997e-167 < z < -2.80000000000000023e-265 or 6.9999999999999994e-225 < z < 5.49999999999999958e-31

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot a} \]
    8. Simplified75.8%

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

    if -2.80000000000000023e-265 < z < 6.9999999999999994e-225

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{t}} \]
    8. Simplified90.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+17}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-167}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-265}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-225}:\\ \;\;\;\;x - y \cdot \frac{a}{t}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-31}:\\ \;\;\;\;x - y \cdot a\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 86.0% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-34}:\\
\;\;\;\;x + z \cdot \frac{a}{t + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.05e14 or 2.6e5 < z

    1. Initial program 94.7%

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

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

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

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

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

    if -1.05e14 < z < 1.6e-126

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

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

    if 1.6e-126 < z < 3.69999999999999988e-34

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - z \cdot \frac{\color{blue}{-a}}{1 + t} \]
    10. Simplified91.2%

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

    if 3.69999999999999988e-34 < z < 2.6e5

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{1 + t}} \]
    7. Simplified90.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-126}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-34}:\\ \;\;\;\;x + z \cdot \frac{a}{t + 1}\\ \mathbf{elif}\;z \leq 260000:\\ \;\;\;\;x + y \cdot \frac{a}{-1 - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 85.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+25}:\\
\;\;\;\;x + z \cdot \frac{a}{\left(t + 1\right) - z}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -7.49999999999999993e25

    1. Initial program 92.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 y around 0 78.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999993e25 < z < 9.5000000000000003e-126

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

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

    if 9.5000000000000003e-126 < z < 2.9000000000000001e-31

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - z \cdot \frac{\color{blue}{-a}}{1 + t} \]
    10. Simplified91.2%

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

    if 2.9000000000000001e-31 < z < 5e5

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{1 + t}} \]
    7. Simplified90.3%

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

    if 5e5 < z

    1. Initial program 96.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+25}:\\ \;\;\;\;x + z \cdot \frac{a}{\left(t + 1\right) - z}\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-126}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-31}:\\ \;\;\;\;x + z \cdot \frac{a}{t + 1}\\ \mathbf{elif}\;z \leq 500000:\\ \;\;\;\;x + y \cdot \frac{a}{-1 - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 86.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+21}:\\
\;\;\;\;x - a \cdot \frac{z}{z + \left(-1 - t\right)}\\

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

\mathbf{elif}\;z \leq 1.65 \cdot 10^{-34}:\\
\;\;\;\;x + z \cdot \frac{a}{t + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -4.5e21

    1. Initial program 92.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 y around 0 93.7%

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

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

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

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

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

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

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

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

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

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

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

    if -4.5e21 < z < 5.59999999999999983e-126

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

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

    if 5.59999999999999983e-126 < z < 1.64999999999999991e-34

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - z \cdot \frac{\color{blue}{-a}}{1 + t} \]
    10. Simplified91.2%

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

    if 1.64999999999999991e-34 < z < 255000

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{1 + t}} \]
    7. Simplified90.3%

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

    if 255000 < z

    1. Initial program 96.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+21}:\\ \;\;\;\;x - a \cdot \frac{z}{z + \left(-1 - t\right)}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-126}:\\ \;\;\;\;x - a \cdot \frac{y}{t + 1}\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-34}:\\ \;\;\;\;x + z \cdot \frac{a}{t + 1}\\ \mathbf{elif}\;z \leq 255000:\\ \;\;\;\;x + y \cdot \frac{a}{-1 - t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 91.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+24}:\\
\;\;\;\;x - a \cdot \frac{z}{z + \left(-1 - t\right)}\\

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

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


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

    1. Initial program 92.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 y around 0 93.7%

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

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

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

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

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

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

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

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

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

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

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

    if -2.2999999999999999e24 < z < 255000

    1. Initial program 99.1%

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

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

    if 255000 < z

    1. Initial program 96.8%

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

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

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

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

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

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

Alternative 10: 91.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+23}:\\
\;\;\;\;x - a \cdot \frac{z}{z + \left(-1 - t\right)}\\

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

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


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

    1. Initial program 92.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 y around 0 93.7%

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

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

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

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

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

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

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

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

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

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

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

    if -7.9999999999999993e23 < z < 820

    1. Initial program 99.1%

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

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

    if 820 < z

    1. Initial program 96.8%

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

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

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

Alternative 11: 84.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+30} \lor \neg \left(z \leq 5000\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.02e+30) (not (<= z 5000.0)))
   (- 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.02e+30) || !(z <= 5000.0)) {
		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.02d+30)) .or. (.not. (z <= 5000.0d0))) 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.02e+30) || !(z <= 5000.0)) {
		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.02e+30) or not (z <= 5000.0):
		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.02e+30) || !(z <= 5000.0))
		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.02e+30) || ~((z <= 5000.0)))
		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.02e+30], N[Not[LessEqual[z, 5000.0]], $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.02 \cdot 10^{+30} \lor \neg \left(z \leq 5000\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.02e30 or 5e3 < z

    1. Initial program 94.5%

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

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

    if -1.02e30 < z < 5e3

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a}{1 + t}} \]
    7. Simplified87.0%

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

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

Alternative 12: 84.6% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25000000000000011e24 or 1.02e6 < z

    1. Initial program 94.5%

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

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

    if -1.25000000000000011e24 < z < 1.02e6

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

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

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

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

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

Alternative 13: 84.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4999999999999998e22 or 400 < z

    1. Initial program 94.5%

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

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

    if -4.4999999999999998e22 < z < 400

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

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

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

      \[\leadsto x - \color{blue}{\frac{y}{1 + t}} \cdot a \]
    6. Step-by-step derivation
      1. *-commutative87.2%

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

        \[\leadsto x - a \cdot \color{blue}{\frac{1}{\frac{1 + t}{y}}} \]
      3. un-div-inv87.2%

        \[\leadsto x - \color{blue}{\frac{a}{\frac{1 + t}{y}}} \]
      4. +-commutative87.2%

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

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

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

Alternative 14: 66.1% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e22 or 2.00000000000000007e-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 82.9%

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

    if -1.2e22 < z < 2.00000000000000007e-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.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + a \cdot z} \]
    10. Step-by-step derivation
      1. +-commutative63.2%

        \[\leadsto \color{blue}{a \cdot z + x} \]
    11. Simplified63.2%

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

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

Alternative 15: 72.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+26} \lor \neg \left(z \leq 4 \cdot 10^{-32}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.45e26 or 4.00000000000000022e-32 < z

    1. Initial program 94.9%

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

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

    if -1.45e26 < z < 4.00000000000000022e-32

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot a} \]
    8. Simplified67.8%

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

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

Alternative 16: 66.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -48000000000000 \lor \neg \left(z \leq 54\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8e13 or 54 < 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 82.0%

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

    if -4.8e13 < z < 54

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -48000000000000 \lor \neg \left(z \leq 54\right):\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 53.9% 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.6%

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Final simplification55.9%

    \[\leadsto x \]
  8. Add Preprocessing

Developer target: 99.6% accurate, 1.0× speedup?

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

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

Reproduce

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