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

Percentage Accurate: 96.9% → 99.7%
Time: 15.1s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 96.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 72.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -3.3 \cdot 10^{-191}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.22 \cdot 10^{-138}:\\
\;\;\;\;x - a\\

\mathbf{elif}\;t \leq 2 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -0.304999999999999993 or 1.9999999999999999e-7 < t

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

    if -0.304999999999999993 < t < -3.29999999999999981e-191 or 1.22e-138 < t < 2.00000000000000013e-37

    1. Initial program 90.8%

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

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

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

    if -3.29999999999999981e-191 < t < 1.22e-138 or 2.00000000000000013e-37 < t < 1.9999999999999999e-7

    1. Initial program 98.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.305:\\ \;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\ \mathbf{elif}\;t \leq -3.3 \cdot 10^{-191}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{-138}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-37}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-7}:\\ \;\;\;\;x - a\\ \mathbf{else}:\\ \;\;\;\;x + \frac{a}{t} \cdot \left(z - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.1% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.40000000000000013e96 or 2.0999999999999998e-6 < 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 85.5%

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

    if -6.40000000000000013e96 < z < -9.50000000000000103e-271 or 6.4999999999999996e-223 < z < 2.0999999999999998e-6

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

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

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

    if -9.50000000000000103e-271 < z < 6.4999999999999996e-223

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+96}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq -9.5 \cdot 10^{-271}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-223}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-6}:\\ \;\;\;\;x + a \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.1% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z}{\left(t - z\right) + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.19999999999999973e63 or 2.2000000000000002 < z < 4.5000000000000002e119

    1. Initial program 93.6%

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

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

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

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

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

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

    if -9.19999999999999973e63 < z < 2.2000000000000002

    1. Initial program 99.9%

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

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

    if 4.5000000000000002e119 < z

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 88.4% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+119}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.00000000000000036e25 or 2.6999999999999998e119 < z

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000036e25 < z < 2.2000000000000002

    1. Initial program 99.9%

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

      \[\leadsto x - \frac{y - z}{\frac{\color{blue}{1 + t}}{a}} \]
    4. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{\frac{1 + t}{a}}{y - z}}} \]
      2. inv-pow99.9%

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

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

      \[\leadsto x - \color{blue}{{\left(\frac{\frac{t + 1}{a}}{y - z}\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-199.9%

        \[\leadsto x - \color{blue}{\frac{1}{\frac{\frac{t + 1}{a}}{y - z}}} \]
      2. +-commutative99.9%

        \[\leadsto x - \frac{1}{\frac{\frac{\color{blue}{1 + t}}{a}}{y - z}} \]
    7. Simplified99.9%

      \[\leadsto x - \color{blue}{\frac{1}{\frac{\frac{1 + t}{a}}{y - z}}} \]
    8. Taylor expanded in y around inf 88.7%

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

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

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

    if 2.2000000000000002 < z < 2.6999999999999998e119

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

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

        \[\leadsto x - \frac{y - z}{\color{blue}{-z}} \cdot a \]
    7. Simplified95.5%

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

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

Alternative 6: 88.8% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+119}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.00000000000000036e25 or 2.80000000000000013e119 < z

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000036e25 < z < 2.14999999999999991

    1. Initial program 99.9%

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

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

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

    if 2.14999999999999991 < z < 2.80000000000000013e119

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

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

        \[\leadsto x - \frac{y - z}{\color{blue}{-z}} \cdot a \]
    7. Simplified95.5%

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

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

Alternative 7: 89.2% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.00000000000000036e25 or 2.2000000000000002 < 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/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 90.5%

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

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

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

    if -4.00000000000000036e25 < z < 2.2000000000000002

    1. Initial program 99.9%

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

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

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

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

Alternative 8: 84.6% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.40000000000000013e96 or 8.2e58 < 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 88.7%

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

    if -6.40000000000000013e96 < z < 8.2e58

    1. Initial program 98.7%

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

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

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

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

Alternative 9: 73.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+96} \lor \neg \left(z \leq 2.3 \cdot 10^{-6}\right):\\
\;\;\;\;x - a\\

\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(z - y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.40000000000000013e96 or 2.3e-6 < 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 85.5%

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

    if -6.40000000000000013e96 < z < 2.3e-6

    1. Initial program 99.2%

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

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

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

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

Alternative 10: 65.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.6e10 or 2.4500000000000001e60 < 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/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 82.6%

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

    if -5.6e10 < z < 2.4500000000000001e60

    1. Initial program 99.2%

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

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

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

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

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

Alternative 11: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 12: 54.9% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq 2.9 \cdot 10^{-186}:\\
\;\;\;\;-a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.8000000000000004e-211 or 2.90000000000000019e-186 < x

    1. Initial program 99.4%

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

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

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

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

    if -4.8000000000000004e-211 < x < 2.90000000000000019e-186

    1. Initial program 90.0%

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

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

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

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

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

        \[\leadsto \color{blue}{-a} \]
    8. Simplified44.2%

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

Alternative 13: 53.0% 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 97.3%

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

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

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

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

Alternative 14: 3.2% accurate, 13.0× speedup?

\[\begin{array}{l} \\ a \end{array} \]
(FPCore (x y z t a) :precision binary64 a)
double code(double x, double y, double z, double t, double a) {
	return 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 = a
end function
public static double code(double x, double y, double z, double t, double a) {
	return a;
}
def code(x, y, z, t, a):
	return a
function code(x, y, z, t, a)
	return a
end
function tmp = code(x, y, z, t, a)
	tmp = a;
end
code[x_, y_, z_, t_, a_] := a
\begin{array}{l}

\\
a
\end{array}
Derivation
  1. Initial program 97.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-a} \]
  8. Simplified18.3%

    \[\leadsto \color{blue}{-a} \]
  9. Step-by-step derivation
    1. neg-sub018.3%

      \[\leadsto \color{blue}{0 - a} \]
    2. sub-neg18.3%

      \[\leadsto \color{blue}{0 + \left(-a\right)} \]
    3. add-sqr-sqrt8.6%

      \[\leadsto 0 + \color{blue}{\sqrt{-a} \cdot \sqrt{-a}} \]
    4. sqrt-unprod7.6%

      \[\leadsto 0 + \color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \]
    5. sqr-neg7.6%

      \[\leadsto 0 + \sqrt{\color{blue}{a \cdot a}} \]
    6. sqrt-unprod1.5%

      \[\leadsto 0 + \color{blue}{\sqrt{a} \cdot \sqrt{a}} \]
    7. add-sqr-sqrt3.0%

      \[\leadsto 0 + \color{blue}{a} \]
  10. Applied egg-rr3.0%

    \[\leadsto \color{blue}{0 + a} \]
  11. Step-by-step derivation
    1. +-lft-identity3.0%

      \[\leadsto \color{blue}{a} \]
  12. Simplified3.0%

    \[\leadsto \color{blue}{a} \]
  13. Add Preprocessing

Developer target: 99.7% accurate, 1.0× speedup?

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

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

Reproduce

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