Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A

Percentage Accurate: 84.8% → 98.2%
Time: 14.4s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 84.8% accurate, 1.0× speedup?

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

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

Alternative 1: 98.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{-176}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -3e-176)
   (+ x (/ (- y z) (/ (- a z) t)))
   (fma (/ (- y z) (- a z)) t x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -3e-176) {
		tmp = x + ((y - z) / ((a - z) / t));
	} else {
		tmp = fma(((y - z) / (a - z)), t, x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -3e-176)
		tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t)));
	else
		tmp = fma(Float64(Float64(y - z) / Float64(a - z)), t, x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -3e-176], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3e-176

    1. Initial program 79.0%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    5. Applied egg-rr99.8%

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

    if -3e-176 < x

    1. Initial program 86.3%

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

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

        \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot t} + x \]
      3. fma-def99.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{-176}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\ \end{array} \]

Alternative 2: 76.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+122}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{+38}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\

\mathbf{elif}\;z \leq -39000000000000:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq 6 \cdot 10^{+54}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.45e122 or -2.49999999999999985e38 < z < -3.9e13 or 5.9999999999999998e54 < z

    1. Initial program 69.2%

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

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

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

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

    if -1.45e122 < z < -2.49999999999999985e38

    1. Initial program 78.0%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z}\right)} \]
      2. unsub-neg64.4%

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{z}} \]
      3. associate-/l*64.5%

        \[\leadsto x - \color{blue}{\frac{t}{\frac{z}{y}}} \]
    7. Simplified64.5%

      \[\leadsto \color{blue}{x - \frac{t}{\frac{z}{y}}} \]
    8. Taylor expanded in t around 0 64.4%

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

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    10. Simplified64.5%

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

    if -3.9e13 < z < 5.9999999999999998e54

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
    6. Simplified79.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+122}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{+38}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -39000000000000:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+54}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 3: 76.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+126}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{+38}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\

\mathbf{elif}\;z \leq -39000000000000:\\
\;\;\;\;x + z \cdot \frac{t}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.3000000000000001e126 or 3.7000000000000001e50 < z

    1. Initial program 66.8%

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

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

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

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

    if -2.3000000000000001e126 < z < -3.59999999999999969e38

    1. Initial program 78.0%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z}\right)} \]
      2. unsub-neg64.4%

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{z}} \]
      3. associate-/l*64.5%

        \[\leadsto x - \color{blue}{\frac{t}{\frac{z}{y}}} \]
    7. Simplified64.5%

      \[\leadsto \color{blue}{x - \frac{t}{\frac{z}{y}}} \]
    8. Taylor expanded in t around 0 64.4%

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

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    10. Simplified64.5%

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

    if -3.59999999999999969e38 < z < -3.9e13

    1. Initial program 99.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    5. Applied egg-rr99.8%

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    6. Step-by-step derivation
      1. div-inv99.8%

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot z}{a - z}} \]
    9. Step-by-step derivation
      1. mul-1-neg72.3%

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

        \[\leadsto \color{blue}{x - \frac{t \cdot z}{a - z}} \]
      3. *-commutative72.3%

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

        \[\leadsto x - \color{blue}{z \cdot \frac{t}{a - z}} \]
    10. Simplified72.3%

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

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

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

        \[\leadsto x - z \cdot \frac{\color{blue}{-t}}{z} \]
    13. Simplified72.3%

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

    if -3.9e13 < z < 3.7000000000000001e50

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
    6. Simplified79.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+126}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{+38}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq -39000000000000:\\ \;\;\;\;x + z \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+50}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 4: 81.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+14} \lor \neg \left(z \leq 2.2 \cdot 10^{+50}\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e14 or 2.20000000000000017e50 < z

    1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e14 < z < 2.20000000000000017e50

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
    6. Simplified79.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+14} \lor \neg \left(z \leq 2.2 \cdot 10^{+50}\right):\\ \;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \end{array} \]

Alternative 5: 83.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+14} \lor \neg \left(z \leq 0.00075\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e14 or 7.5000000000000002e-4 < z

    1. Initial program 71.6%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(1 + -1 \cdot \frac{y}{z}\right)} \cdot t \]
    8. Step-by-step derivation
      1. mul-1-neg86.3%

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

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

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

    if -1.5e14 < z < 7.5000000000000002e-4

    1. Initial program 94.7%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    5. Applied egg-rr99.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+14} \lor \neg \left(z \leq 0.00075\right):\\ \;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a}\\ \end{array} \]

Alternative 6: 87.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+16} \lor \neg \left(z \leq 1.2 \cdot 10^{+54}\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.8e16 or 1.19999999999999999e54 < z

    1. Initial program 70.2%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(1 + -1 \cdot \frac{y}{z}\right)} \cdot t \]
    8. Step-by-step derivation
      1. mul-1-neg88.5%

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

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

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

    if -4.8e16 < z < 1.19999999999999999e54

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+16} \lor \neg \left(z \leq 1.2 \cdot 10^{+54}\right):\\ \;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \end{array} \]

Alternative 7: 87.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.42e16 < z < 3e51

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

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

    if 3e51 < z

    1. Initial program 66.3%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(t + -1 \cdot \frac{t \cdot y}{z}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg76.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.42 \cdot 10^{+16}:\\ \;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+51}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - \frac{t}{\frac{z}{y}}\right)\\ \end{array} \]

Alternative 8: 87.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.42e16 < z < 3.8e52

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a - z}} \]
    5. Step-by-step derivation
      1. associate-/l*87.3%

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a - z}{y}}} \]
    6. Simplified87.3%

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

    if 3.8e52 < z

    1. Initial program 66.3%

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(t + -1 \cdot \frac{t \cdot y}{z}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg76.3%

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

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

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

      \[\leadsto x + \color{blue}{\left(t - \frac{t}{\frac{z}{y}}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.42 \cdot 10^{+16}:\\ \;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+52}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + \left(t - \frac{t}{\frac{z}{y}}\right)\\ \end{array} \]

Alternative 9: 86.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

    if -9.2e16 < z < 8.5e17

    1. Initial program 94.9%

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

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

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a - z}} \]
    5. Step-by-step derivation
      1. associate-/l*87.6%

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a - z}{y}}} \]
    6. Simplified87.6%

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

    if 8.5e17 < z

    1. Initial program 67.5%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    5. Applied egg-rr94.8%

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    6. Step-by-step derivation
      1. div-inv94.7%

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot z}{a - z}} \]
    9. Step-by-step derivation
      1. mul-1-neg64.2%

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

        \[\leadsto \color{blue}{x - \frac{t \cdot z}{a - z}} \]
      3. *-commutative64.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{+16}:\\ \;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+17}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \frac{t}{a - z}\\ \end{array} \]

Alternative 10: 87.6% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.00000000000000038e-4

    1. Initial program 82.7%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified98.4%

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

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

    if -8.00000000000000038e-4 < y < 2.1000000000000001e23

    1. Initial program 82.7%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified97.6%

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot z}{a - z}} \]
    5. Step-by-step derivation
      1. mul-1-neg76.8%

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

        \[\leadsto \color{blue}{x - \frac{t \cdot z}{a - z}} \]
      3. *-commutative76.8%

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

        \[\leadsto x - \color{blue}{\frac{z}{a - z} \cdot t} \]
    6. Simplified93.2%

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

    if 2.1000000000000001e23 < y

    1. Initial program 86.5%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified97.0%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a - z}} \]
    5. Step-by-step derivation
      1. associate-/l*85.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0008:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+23}:\\ \;\;\;\;x - t \cdot \frac{z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\ \end{array} \]

Alternative 11: 98.1% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5e-176

    1. Initial program 79.0%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    5. Applied egg-rr99.8%

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    6. Step-by-step derivation
      1. div-inv99.8%

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

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

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

    if -5e-176 < x

    1. Initial program 86.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-176}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a - z}\\ \end{array} \]

Alternative 12: 98.2% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e-175

    1. Initial program 79.0%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    5. Applied egg-rr99.8%

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

    if -1.15e-175 < x

    1. Initial program 86.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-175}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a - z}\\ \end{array} \]

Alternative 13: 76.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+14}:\\
\;\;\;\;x + t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8e14 or 2.20000000000000017e50 < z

    1. Initial program 70.5%

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

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

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

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

    if -8e14 < z < 2.20000000000000017e50

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+14}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+50}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 14: 76.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+54}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.65e15 or 3.2e54 < z

    1. Initial program 70.5%

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

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

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

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

    if -1.65e15 < z < 3.2e54

    1. Initial program 94.4%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified95.8%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} + x \]
    6. Simplified79.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+15}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+54}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 15: 95.9% accurate, 1.0× speedup?

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

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
  3. Simplified97.6%

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
  5. Applied egg-rr96.8%

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

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

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

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

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

Alternative 16: 63.0% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.45 \cdot 10^{+129}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 2 \cdot 10^{+125}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.45e129 or 1.9999999999999998e125 < a

    1. Initial program 82.5%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified96.0%

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

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

    if -2.45e129 < a < 1.9999999999999998e125

    1. Initial program 84.2%

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

        \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
    3. Simplified98.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.45 \cdot 10^{+129}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 2 \cdot 10^{+125}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 17: 49.9% accurate, 11.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 83.7%

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t} \]
  3. Simplified97.6%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification46.9%

    \[\leadsto x \]

Developer target: 99.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023275 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
  :precision binary64

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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