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

Percentage Accurate: 96.8% → 99.7%
Time: 13.5s
Alternatives: 15
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 15 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.8% 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 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 75.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{a}{z + -1}\\ t_2 := x - a \cdot \frac{y}{t}\\ t_3 := x - a \cdot \frac{z}{z + -1}\\ \mathbf{if}\;t \leq -1350:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -2.06 \cdot 10^{-209}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-266}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t \leq 3.9 \cdot 10^{-181}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-94}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ a (+ z -1.0)))))
        (t_2 (- x (* a (/ y t))))
        (t_3 (- x (* a (/ z (+ z -1.0))))))
   (if (<= t -1350.0)
     t_2
     (if (<= t -2.06e-209)
       t_1
       (if (<= t -9.2e-266)
         t_3
         (if (<= t 3.9e-181)
           t_1
           (if (<= t 1.2e-94) t_3 (if (<= t 2.4e+14) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (a / (z + -1.0)));
	double t_2 = x - (a * (y / t));
	double t_3 = x - (a * (z / (z + -1.0)));
	double tmp;
	if (t <= -1350.0) {
		tmp = t_2;
	} else if (t <= -2.06e-209) {
		tmp = t_1;
	} else if (t <= -9.2e-266) {
		tmp = t_3;
	} else if (t <= 3.9e-181) {
		tmp = t_1;
	} else if (t <= 1.2e-94) {
		tmp = t_3;
	} else if (t <= 2.4e+14) {
		tmp = t_1;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = x + (y * (a / (z + (-1.0d0))))
    t_2 = x - (a * (y / t))
    t_3 = x - (a * (z / (z + (-1.0d0))))
    if (t <= (-1350.0d0)) then
        tmp = t_2
    else if (t <= (-2.06d-209)) then
        tmp = t_1
    else if (t <= (-9.2d-266)) then
        tmp = t_3
    else if (t <= 3.9d-181) then
        tmp = t_1
    else if (t <= 1.2d-94) then
        tmp = t_3
    else if (t <= 2.4d+14) then
        tmp = t_1
    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 + (y * (a / (z + -1.0)));
	double t_2 = x - (a * (y / t));
	double t_3 = x - (a * (z / (z + -1.0)));
	double tmp;
	if (t <= -1350.0) {
		tmp = t_2;
	} else if (t <= -2.06e-209) {
		tmp = t_1;
	} else if (t <= -9.2e-266) {
		tmp = t_3;
	} else if (t <= 3.9e-181) {
		tmp = t_1;
	} else if (t <= 1.2e-94) {
		tmp = t_3;
	} else if (t <= 2.4e+14) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (a / (z + -1.0)))
	t_2 = x - (a * (y / t))
	t_3 = x - (a * (z / (z + -1.0)))
	tmp = 0
	if t <= -1350.0:
		tmp = t_2
	elif t <= -2.06e-209:
		tmp = t_1
	elif t <= -9.2e-266:
		tmp = t_3
	elif t <= 3.9e-181:
		tmp = t_1
	elif t <= 1.2e-94:
		tmp = t_3
	elif t <= 2.4e+14:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(a / Float64(z + -1.0))))
	t_2 = Float64(x - Float64(a * Float64(y / t)))
	t_3 = Float64(x - Float64(a * Float64(z / Float64(z + -1.0))))
	tmp = 0.0
	if (t <= -1350.0)
		tmp = t_2;
	elseif (t <= -2.06e-209)
		tmp = t_1;
	elseif (t <= -9.2e-266)
		tmp = t_3;
	elseif (t <= 3.9e-181)
		tmp = t_1;
	elseif (t <= 1.2e-94)
		tmp = t_3;
	elseif (t <= 2.4e+14)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (a / (z + -1.0)));
	t_2 = x - (a * (y / t));
	t_3 = x - (a * (z / (z + -1.0)));
	tmp = 0.0;
	if (t <= -1350.0)
		tmp = t_2;
	elseif (t <= -2.06e-209)
		tmp = t_1;
	elseif (t <= -9.2e-266)
		tmp = t_3;
	elseif (t <= 3.9e-181)
		tmp = t_1;
	elseif (t <= 1.2e-94)
		tmp = t_3;
	elseif (t <= 2.4e+14)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(a / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(a * N[(z / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1350.0], t$95$2, If[LessEqual[t, -2.06e-209], t$95$1, If[LessEqual[t, -9.2e-266], t$95$3, If[LessEqual[t, 3.9e-181], t$95$1, If[LessEqual[t, 1.2e-94], t$95$3, If[LessEqual[t, 2.4e+14], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{a}{z + -1}\\
t_2 := x - a \cdot \frac{y}{t}\\
t_3 := x - a \cdot \frac{z}{z + -1}\\
\mathbf{if}\;t \leq -1350:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -2.06 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -9.2 \cdot 10^{-266}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t \leq 3.9 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{-94}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1350 or 2.4e14 < 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/99.9%

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

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

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

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

    if -1350 < t < -2.0600000000000001e-209 or -9.19999999999999986e-266 < t < 3.9e-181 or 1.2e-94 < t < 2.4e14

    1. Initial program 98.8%

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

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

      \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 - z}} \]
    5. Step-by-step derivation
      1. *-commutative81.3%

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

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

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

    if -2.0600000000000001e-209 < t < -9.19999999999999986e-266 or 3.9e-181 < t < 1.2e-94

    1. Initial program 97.3%

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

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

      \[\leadsto x - \color{blue}{-1 \cdot \frac{a \cdot z}{1 - z}} \]
    5. Step-by-step derivation
      1. mul-1-neg62.0%

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

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

        \[\leadsto x - \color{blue}{a \cdot \left(-\frac{z}{1 - z}\right)} \]
      4. distribute-frac-neg287.0%

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

        \[\leadsto x - a \cdot \frac{z}{\color{blue}{0 - \left(1 - z\right)}} \]
      6. associate--r-87.0%

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

        \[\leadsto x - a \cdot \frac{z}{\color{blue}{-1} + z} \]
    6. Simplified87.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1350:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \mathbf{elif}\;t \leq -2.06 \cdot 10^{-209}:\\ \;\;\;\;x + y \cdot \frac{a}{z + -1}\\ \mathbf{elif}\;t \leq -9.2 \cdot 10^{-266}:\\ \;\;\;\;x - a \cdot \frac{z}{z + -1}\\ \mathbf{elif}\;t \leq 3.9 \cdot 10^{-181}:\\ \;\;\;\;x + y \cdot \frac{a}{z + -1}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-94}:\\ \;\;\;\;x - a \cdot \frac{z}{z + -1}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+14}:\\ \;\;\;\;x + y \cdot \frac{a}{z + -1}\\ \mathbf{else}:\\ \;\;\;\;x - a \cdot \frac{y}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.3% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+74}:\\
\;\;\;\;x + a \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.9499999999999999e28 or 2.40000000000000008e74 < z

    1. Initial program 98.0%

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

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

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

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

    if -1.9499999999999999e28 < z < 0.0134999999999999998

    1. Initial program 99.9%

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

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

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

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

    if 0.0134999999999999998 < z < 7.2e45

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

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

      \[\leadsto x - \color{blue}{\frac{a \cdot y}{1 - z}} \]
    5. Step-by-step derivation
      1. *-commutative80.0%

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

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

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

    if 7.2e45 < z < 2.40000000000000008e74

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+28}:\\ \;\;\;\;x - a\\ \mathbf{elif}\;z \leq 0.0135:\\ \;\;\;\;x + a \cdot \frac{y}{-1 - t}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+45}:\\ \;\;\;\;x + y \cdot \frac{a}{z + -1}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+74}:\\ \;\;\;\;x + a \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x - a\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.2% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.75 \cdot 10^{+175}:\\
\;\;\;\;x + \frac{z \cdot a}{\left(t + 1\right) - z}\\

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


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

    1. Initial program 98.5%

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

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

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

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

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

    if -2.15e11 < z < 0.849999999999999978

    1. Initial program 99.9%

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

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

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

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

    if 0.849999999999999978 < z < 2.75000000000000009e175

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.75000000000000009e175 < z

    1. Initial program 99.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 100.0%

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

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

Alternative 5: 84.3% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.6000000000000002e28 or 6.39999999999999969e75 < z

    1. Initial program 98.0%

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

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

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

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

    if -2.6000000000000002e28 < z < 15

    1. Initial program 99.9%

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

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

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

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

    if 15 < z < 6.39999999999999969e75

    1. Initial program 95.6%

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

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

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

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

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

Alternative 6: 85.3% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 98.5%

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

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

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

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

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

    if -7.4e6 < z < 0.46000000000000002

    1. Initial program 99.9%

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

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

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

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

    if 0.46000000000000002 < z < 8.99999999999999969e73

    1. Initial program 95.6%

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

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

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

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

    if 8.99999999999999969e73 < z

    1. Initial program 97.1%

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

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

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

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

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

Alternative 7: 75.0% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.2e15 or 1.4500000000000001e74 < z

    1. Initial program 98.0%

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

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

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

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

    if -8.2e15 < z < 3.6000000000000001e-24

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

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

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

    if 3.6000000000000001e-24 < z < 1.4500000000000001e74

    1. Initial program 96.3%

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

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

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

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

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

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

Alternative 8: 74.6% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.34999999999999994e-27

    1. Initial program 98.5%

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

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

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

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

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

        \[\leadsto x - \color{blue}{a \cdot \left(-\frac{z}{1 - z}\right)} \]
      4. distribute-frac-neg277.6%

        \[\leadsto x - a \cdot \color{blue}{\frac{z}{-\left(1 - z\right)}} \]
      5. neg-sub077.6%

        \[\leadsto x - a \cdot \frac{z}{\color{blue}{0 - \left(1 - z\right)}} \]
      6. associate--r-77.6%

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

        \[\leadsto x - a \cdot \frac{z}{\color{blue}{-1} + z} \]
    6. Simplified77.6%

      \[\leadsto x - \color{blue}{a \cdot \frac{z}{-1 + z}} \]
    7. Taylor expanded in z around inf 77.8%

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

    if -1.34999999999999994e-27 < z < 4.1999999999999999e-24

    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}{\color{blue}{\frac{1 + t}{a}}} \]
    4. Taylor expanded in t around 0 78.0%

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

    if 4.1999999999999999e-24 < z < 2.0999999999999999e74

    1. Initial program 96.3%

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

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

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

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

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

    if 2.0999999999999999e74 < z

    1. Initial program 97.1%

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

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

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

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

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

Alternative 9: 89.2% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

    if -1.4500000000000001e28 < z < 4.99999999999999991e76

    1. Initial program 99.3%

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

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

    if 4.99999999999999991e76 < z

    1. Initial program 97.1%

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

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

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

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

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

Alternative 10: 90.1% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 98.5%

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

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

    if -9.5e5 < t < 2.59999999999999992e23

    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 0 97.8%

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

    if 2.59999999999999992e23 < t

    1. Initial program 99.8%

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

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

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

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

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

Alternative 11: 74.8% accurate, 0.8× speedup?

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

    1. Initial program 97.7%

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

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

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

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

    if -2e16 < z < 4.9999999999999998e-24

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

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

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

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

Alternative 12: 73.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+28} \lor \neg \left(z \leq 5 \cdot 10^{-24}\right):\\
\;\;\;\;x - a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.99999999999999958e27 or 4.9999999999999998e-24 < z

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

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

    if -9.99999999999999958e27 < z < 4.9999999999999998e-24

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

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

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

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

Alternative 13: 66.7% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e28 or 4.99999999999999954e-22 < z

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

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

    if -1.7e28 < z < 4.99999999999999954e-22

    1. Initial program 99.9%

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

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

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

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

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

Alternative 14: 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 98.8%

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

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

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

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

Alternative 15: 54.4% accurate, 13.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 98.8%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification56.3%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 99.7% accurate, 1.0× speedup?

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

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

Reproduce

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