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

Percentage Accurate: 98.3% → 98.5%
Time: 11.0s
Alternatives: 20
Speedup: 1.0×

Specification

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

\\
x + y \cdot \frac{z - t}{z - 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 20 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: 98.3% accurate, 1.0× speedup?

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

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}

Alternative 1: 98.5% accurate, 1.0× speedup?

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

\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
Derivation
  1. Initial program 98.4%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. clear-num98.3%

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

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

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

Alternative 2: 59.0% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-228}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-251}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.9999999999999996e-126 or 1.65e-111 < z

    1. Initial program 99.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 68.9%

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

    if -7.9999999999999996e-126 < z < -4.3999999999999999e-203 or 4.49999999999999978e-251 < z < 1.65e-111

    1. Initial program 96.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 63.7%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
      2. *-commutative72.4%

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

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

    if -4.3999999999999999e-203 < z < -2.40000000000000002e-228 or -2.0000000000000001e-292 < z < 4.49999999999999978e-251

    1. Initial program 95.6%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 87.2%

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

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

    if -2.40000000000000002e-228 < z < -2.0000000000000001e-292

    1. Initial program 89.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 89.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-126}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-203}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-228}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-292}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-251}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{-111}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+150}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.40000000000000005e150 or 2.09999999999999992e-17 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.8%

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

    if -1.40000000000000005e150 < z < -7.1999999999999996e-22

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 84.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{-z} \cdot y} \]
      2. add-sqr-sqrt79.9%

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \cdot y \]
      3. sqrt-unprod80.1%

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \cdot y \]
      4. sqr-neg80.1%

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

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

        \[\leadsto x + \frac{t}{\color{blue}{z}} \cdot y \]
      7. cancel-sign-sub56.8%

        \[\leadsto \color{blue}{x - \left(-\frac{t}{z}\right) \cdot y} \]
      8. distribute-frac-neg256.8%

        \[\leadsto x - \color{blue}{\frac{t}{-z}} \cdot y \]
      9. *-commutative56.8%

        \[\leadsto x - \color{blue}{y \cdot \frac{t}{-z}} \]
      10. add-sqr-sqrt56.8%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      11. sqrt-unprod56.8%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      12. sqr-neg56.8%

        \[\leadsto x - y \cdot \frac{t}{\sqrt{\color{blue}{z \cdot z}}} \]
      13. sqrt-unprod0.0%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      14. add-sqr-sqrt80.1%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{z}} \]
    8. Applied egg-rr80.1%

      \[\leadsto \color{blue}{x - y \cdot \frac{t}{z}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt44.7%

        \[\leadsto x - \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \frac{t}{z} \]
      2. sqrt-unprod68.7%

        \[\leadsto x - \color{blue}{\sqrt{y \cdot y}} \cdot \frac{t}{z} \]
      3. sqr-neg68.7%

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

        \[\leadsto x - \color{blue}{\left(\sqrt{-y} \cdot \sqrt{-y}\right)} \cdot \frac{t}{z} \]
      5. add-sqr-sqrt56.8%

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

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

        \[\leadsto x - \color{blue}{\frac{-y}{z} \cdot t} \]
      8. add-sqr-sqrt28.2%

        \[\leadsto x - \frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{z} \cdot t \]
      9. sqrt-unprod68.8%

        \[\leadsto x - \frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{z} \cdot t \]
      10. sqr-neg68.8%

        \[\leadsto x - \frac{\sqrt{\color{blue}{y \cdot y}}}{z} \cdot t \]
      11. sqrt-unprod44.7%

        \[\leadsto x - \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{z} \cdot t \]
      12. add-sqr-sqrt80.2%

        \[\leadsto x - \frac{\color{blue}{y}}{z} \cdot t \]
    10. Applied egg-rr80.2%

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

    if -7.1999999999999996e-22 < z < 2.09999999999999992e-17

    1. Initial program 96.1%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 71.4%

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
      2. *-commutative75.0%

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot t} \]
    5. Applied egg-rr75.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+150}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -7.2 \cdot 10^{-22}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-17}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 76.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+151}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.20000000000000005e151 or 8.20000000000000012e-16 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.8%

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

    if -1.20000000000000005e151 < z < -2.2999999999999999e-20

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 84.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{-z} \cdot y} \]
      2. add-sqr-sqrt79.9%

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \cdot y \]
      3. sqrt-unprod80.1%

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \cdot y \]
      4. sqr-neg80.1%

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

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

        \[\leadsto x + \frac{t}{\color{blue}{z}} \cdot y \]
      7. cancel-sign-sub56.8%

        \[\leadsto \color{blue}{x - \left(-\frac{t}{z}\right) \cdot y} \]
      8. distribute-frac-neg256.8%

        \[\leadsto x - \color{blue}{\frac{t}{-z}} \cdot y \]
      9. *-commutative56.8%

        \[\leadsto x - \color{blue}{y \cdot \frac{t}{-z}} \]
      10. add-sqr-sqrt56.8%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      11. sqrt-unprod56.8%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      12. sqr-neg56.8%

        \[\leadsto x - y \cdot \frac{t}{\sqrt{\color{blue}{z \cdot z}}} \]
      13. sqrt-unprod0.0%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      14. add-sqr-sqrt80.1%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{z}} \]
    8. Applied egg-rr80.1%

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

    if -2.2999999999999999e-20 < z < 8.20000000000000012e-16

    1. Initial program 96.1%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 71.4%

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
      2. *-commutative75.0%

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot t} \]
    5. Applied egg-rr75.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+151}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-20}:\\ \;\;\;\;x - y \cdot \frac{t}{z}\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-16}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 57.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+65}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq -6 \cdot 10^{-10}:\\
\;\;\;\;y \cdot \left(t \cdot \frac{1}{a}\right)\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{+243}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.3999999999999999e65 or -6e-10 < t < 3.49999999999999988e243

    1. Initial program 99.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 63.7%

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

    if -3.3999999999999999e65 < t < -6e-10

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 67.4%

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    5. Step-by-step derivation
      1. div-inv67.3%

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

        \[\leadsto \color{blue}{\left(y \cdot t\right)} \cdot \frac{1}{a} \]
      3. associate-*l*67.4%

        \[\leadsto \color{blue}{y \cdot \left(t \cdot \frac{1}{a}\right)} \]
    6. Applied egg-rr67.4%

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

    if 3.49999999999999988e243 < t

    1. Initial program 88.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 78.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{-z} \cdot y} \]
      2. add-sqr-sqrt39.3%

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

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \cdot y \]
      4. sqr-neg34.8%

        \[\leadsto x + \frac{t}{\sqrt{\color{blue}{z \cdot z}}} \cdot y \]
      5. sqrt-unprod5.9%

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \cdot y \]
      6. add-sqr-sqrt11.8%

        \[\leadsto x + \frac{t}{\color{blue}{z}} \cdot y \]
      7. cancel-sign-sub11.8%

        \[\leadsto \color{blue}{x - \left(-\frac{t}{z}\right) \cdot y} \]
      8. distribute-frac-neg211.8%

        \[\leadsto x - \color{blue}{\frac{t}{-z}} \cdot y \]
      9. *-commutative11.8%

        \[\leadsto x - \color{blue}{y \cdot \frac{t}{-z}} \]
      10. add-sqr-sqrt5.9%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      11. sqrt-unprod40.1%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      12. sqr-neg40.1%

        \[\leadsto x - y \cdot \frac{t}{\sqrt{\color{blue}{z \cdot z}}} \]
      13. sqrt-unprod39.1%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      14. add-sqr-sqrt78.5%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg59.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \left(-y\right)} \]
    11. Simplified73.0%

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

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

Alternative 6: 57.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+65}:\\
\;\;\;\;x + y\\

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

\mathbf{elif}\;t \leq 3.5 \cdot 10^{+243}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.3999999999999999e65 or -6e-10 < t < 3.49999999999999988e243

    1. Initial program 99.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 63.7%

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

    if -3.3999999999999999e65 < t < -6e-10

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 67.4%

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

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

    if 3.49999999999999988e243 < t

    1. Initial program 88.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 78.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{-z} \cdot y} \]
      2. add-sqr-sqrt39.3%

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

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \cdot y \]
      4. sqr-neg34.8%

        \[\leadsto x + \frac{t}{\sqrt{\color{blue}{z \cdot z}}} \cdot y \]
      5. sqrt-unprod5.9%

        \[\leadsto x + \frac{t}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \cdot y \]
      6. add-sqr-sqrt11.8%

        \[\leadsto x + \frac{t}{\color{blue}{z}} \cdot y \]
      7. cancel-sign-sub11.8%

        \[\leadsto \color{blue}{x - \left(-\frac{t}{z}\right) \cdot y} \]
      8. distribute-frac-neg211.8%

        \[\leadsto x - \color{blue}{\frac{t}{-z}} \cdot y \]
      9. *-commutative11.8%

        \[\leadsto x - \color{blue}{y \cdot \frac{t}{-z}} \]
      10. add-sqr-sqrt5.9%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      11. sqrt-unprod40.1%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      12. sqr-neg40.1%

        \[\leadsto x - y \cdot \frac{t}{\sqrt{\color{blue}{z \cdot z}}} \]
      13. sqrt-unprod39.1%

        \[\leadsto x - y \cdot \frac{t}{\color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      14. add-sqr-sqrt78.5%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg59.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{z} \cdot \left(-y\right)} \]
    11. Simplified73.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.4 \cdot 10^{+65}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-10}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{+243}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{t}{-z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 60.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-45}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-251}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.89999999999999999e-45 or 1.69999999999999998e-111 < z

    1. Initial program 99.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 71.8%

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

    if -1.89999999999999999e-45 < z < 4.19999999999999964e-251

    1. Initial program 96.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 81.5%

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

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

    if 4.19999999999999964e-251 < z < 1.69999999999999998e-111

    1. Initial program 95.1%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 55.6%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
      2. *-commutative64.4%

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot t} \]
    6. Applied egg-rr50.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{-45}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-251}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-111}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 87.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-55} \lor \neg \left(t \leq 1.2 \cdot 10^{+45}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.8e-55 or 1.19999999999999995e45 < t

    1. Initial program 97.1%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num97.0%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    4. Applied egg-rr97.9%

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{\color{blue}{\left(0 - z\right) + a}}{t}} \]
      5. neg-sub090.9%

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

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

    if -1.8e-55 < t < 1.19999999999999995e45

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.8%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z} - \frac{a}{z}}} \]
      2. *-inverses94.1%

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

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

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

Alternative 9: 80.7% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.49999999999999999e25 or 1.4500000000000001e-85 < z

    1. Initial program 99.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 83.6%

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

    if -3.49999999999999999e25 < z < 1.4500000000000001e-85

    1. Initial program 97.1%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 74.7%

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

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

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

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

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

Alternative 10: 82.7% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.3e-20

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.8%

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

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

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

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

    if -3.3e-20 < z < 8.3999999999999998e-79

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num96.6%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{-\frac{a}{z - t}}} \]
      2. distribute-neg-frac281.7%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a}{-\left(z - t\right)}}} \]
      3. sub-neg81.7%

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

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

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

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

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

    if 8.3999999999999998e-79 < z

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.7%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z} - \frac{a}{z}}} \]
      2. *-inverses83.1%

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

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

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

Alternative 11: 82.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-86}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.39999999999999982e-20

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.8%

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

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

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

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

    if -4.39999999999999982e-20 < z < 4.4999999999999998e-86

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num96.6%

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

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

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

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

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

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

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

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

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

    if 4.4999999999999998e-86 < z

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.7%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z} - \frac{a}{z}}} \]
      2. *-inverses83.1%

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

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

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

Alternative 12: 82.6% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.99999999999999973e-22

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.8%

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

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

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

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

    if -8.99999999999999973e-22 < z < 1.0800000000000001e-78

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 78.9%

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

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

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

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

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

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

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

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

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

    if 1.0800000000000001e-78 < z

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.7%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z} - \frac{a}{z}}} \]
      2. *-inverses83.1%

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

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

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

Alternative 13: 81.5% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.99999999999999945e-21

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.8%

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

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

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

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

    if -9.99999999999999945e-21 < z < 7.4999999999999999e-89

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 76.0%

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

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

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

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

    if 7.4999999999999999e-89 < z

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.7%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z} - \frac{a}{z}}} \]
      2. *-inverses83.1%

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

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

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

Alternative 14: 81.5% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3500000000000001e-21

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 87.1%

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

    if -1.3500000000000001e-21 < z < 7.20000000000000032e-92

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 76.0%

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

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

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

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

    if 7.20000000000000032e-92 < z

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num98.7%

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z} - \frac{a}{z}}} \]
      2. *-inverses83.1%

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

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

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

Alternative 15: 81.5% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9e-21

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 87.1%

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

    if -2.9e-21 < z < 2.15000000000000007e-92

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 76.0%

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

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

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

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

    if 2.15000000000000007e-92 < z

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 83.1%

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

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

Alternative 16: 76.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+29} \lor \neg \left(z \leq 1.46 \cdot 10^{-15}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6e29 or 1.4600000000000001e-15 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 76.5%

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

    if -2.6e29 < z < 1.4600000000000001e-15

    1. Initial program 96.6%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 70.8%

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
      2. *-commutative73.7%

        \[\leadsto x + \color{blue}{\frac{y}{a} \cdot t} \]
    5. Applied egg-rr73.7%

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

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

Alternative 17: 76.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+39} \lor \neg \left(z \leq 2.2 \cdot 10^{-15}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.50000000000000011e39 or 2.19999999999999986e-15 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 76.7%

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

    if -9.50000000000000011e39 < z < 2.19999999999999986e-15

    1. Initial program 96.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 72.7%

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

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

Alternative 18: 61.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-42} \lor \neg \left(z \leq 1.95 \cdot 10^{-219}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6e-42 or 1.94999999999999994e-219 < z

    1. Initial program 98.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 67.0%

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

    if -2.6e-42 < z < 1.94999999999999994e-219

    1. Initial program 97.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 79.5%

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

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

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

Alternative 19: 98.3% accurate, 1.0× speedup?

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

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Derivation
  1. Initial program 98.4%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 20: 50.3% 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 98.4%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0 56.8%

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

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

Developer target: 98.5% accurate, 1.0× speedup?

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

\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}

Reproduce

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

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

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