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

Percentage Accurate: 85.5% → 99.5%
Time: 13.2s
Alternatives: 21
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y \cdot \left(z - t\right)}{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 21 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: 85.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.5% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+277}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+257}:\\
\;\;\;\;t\_1 + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4.99999999999999982e277

    1. Initial program 49.5%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing

    if -4.99999999999999982e277 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000006e257

    1. Initial program 99.9%

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

    if 2.00000000000000006e257 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 40.8%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq -5 \cdot 10^{+277}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq 2 \cdot 10^{+257}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a} + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+257}\right):\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+257)))
     (+ x (/ y (/ (- z a) (- z t))))
     (+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+257)) {
		tmp = x + (y / ((z - a) / (z - t)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+257)) {
		tmp = x + (y / ((z - a) / (z - t)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 2e+257):
		tmp = x + (y / ((z - a) / (z - t)))
	else:
		tmp = t_1 + x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+257))
		tmp = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t))));
	else
		tmp = Float64(t_1 + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (z - a);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 2e+257)))
		tmp = x + (y / ((z - a) / (z - t)));
	else
		tmp = t_1 + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+257]], $MachinePrecision]], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+257}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 2.00000000000000006e257 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 43.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000006e257

    1. Initial program 99.9%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

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

Alternative 3: 99.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+212}\right):\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+212)))
     (+ x (* (- z t) (/ y (- z a))))
     (+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+212)) {
		tmp = x + ((z - t) * (y / (z - a)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+212)) {
		tmp = x + ((z - t) * (y / (z - a)));
	} else {
		tmp = t_1 + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 2e+212):
		tmp = x + ((z - t) * (y / (z - a)))
	else:
		tmp = t_1 + x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+212))
		tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a))));
	else
		tmp = Float64(t_1 + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (z - a);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 2e+212)))
		tmp = x + ((z - t) * (y / (z - a)));
	else
		tmp = t_1 + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+212]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+212}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 1.9999999999999998e212 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 46.1%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine96.4%

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 1.9999999999999998e212

    1. Initial program 99.9%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

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

Alternative 4: 96.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+277} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+257}\right):\\
\;\;\;\;y \cdot \frac{z - t}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -4.99999999999999982e277 or 2.00000000000000006e257 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 45.1%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.9%

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
    9. Taylor expanded in y around inf 95.0%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    10. Step-by-step derivation
      1. div-sub95.0%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Simplified95.0%

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

    if -4.99999999999999982e277 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000006e257

    1. Initial program 99.9%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification98.9%

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

Alternative 5: 99.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+257}:\\ \;\;\;\;t\_1 + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (<= t_1 (- INFINITY))
     (+ x (/ (- z t) (/ (- z a) y)))
     (if (<= t_1 2e+257) (+ t_1 x) (+ x (/ y (/ (- z a) (- z t))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = x + ((z - t) / ((z - a) / y));
	} else if (t_1 <= 2e+257) {
		tmp = t_1 + x;
	} else {
		tmp = x + (y / ((z - a) / (z - t)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = x + ((z - t) / ((z - a) / y));
	} else if (t_1 <= 2e+257) {
		tmp = t_1 + x;
	} else {
		tmp = x + (y / ((z - a) / (z - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = x + ((z - t) / ((z - a) / y))
	elif t_1 <= 2e+257:
		tmp = t_1 + x
	else:
		tmp = x + (y / ((z - a) / (z - t)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y)));
	elseif (t_1 <= 2e+257)
		tmp = Float64(t_1 + x);
	else
		tmp = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (z - a);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = x + ((z - t) / ((z - a) / y));
	elseif (t_1 <= 2e+257)
		tmp = t_1 + x;
	else
		tmp = x + (y / ((z - a) / (z - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+257], N[(t$95$1 + x), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+257}:\\
\;\;\;\;t\_1 + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0

    1. Initial program 45.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine100.0%

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000006e257

    1. Initial program 99.9%

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

    if 2.00000000000000006e257 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 40.8%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -4 \cdot 10^{-88}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 78.4%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.22000000000000007e95 < z < -3.99999999999999974e-88 or 1.9e-13 < z < 1.1e124

    1. Initial program 89.4%

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

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

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

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

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

    if -3.99999999999999974e-88 < z < 5.4999999999999997e-60

    1. Initial program 96.7%

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    5. Simplified83.1%

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

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

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

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

    if 5.4999999999999997e-60 < z < 1.9e-13

    1. Initial program 99.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.6%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. inv-pow99.6%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr99.6%

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-199.6%

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

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
    9. Taylor expanded in y around inf 99.7%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    10. Step-by-step derivation
      1. div-sub99.7%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Simplified99.7%

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

    if 1.1e124 < z

    1. Initial program 78.0%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub94.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.22 \cdot 10^{+95}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-88}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-60}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-13}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+124}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 82.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.46 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.3e94 or 1.30000000000000002e125 < z

    1. Initial program 78.2%

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

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

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

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

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

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

    if -2.3e94 < z < -1.45999999999999993e-86 or 2.8000000000000002e-13 < z < 1.30000000000000002e125

    1. Initial program 89.4%

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

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

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

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

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

    if -1.45999999999999993e-86 < z < 6.19999999999999976e-60

    1. Initial program 96.7%

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    5. Simplified83.1%

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

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

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

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

    if 6.19999999999999976e-60 < z < 2.8000000000000002e-13

    1. Initial program 99.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num99.6%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. inv-pow99.6%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr99.6%

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-199.6%

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

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
    9. Taylor expanded in y around inf 99.7%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    10. Step-by-step derivation
      1. div-sub99.7%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Simplified99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+94}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;z \leq -1.46 \cdot 10^{-86}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-60}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-13}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+125}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 79.8% accurate, 0.4× speedup?

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

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

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

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

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

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


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

    1. Initial program 78.3%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1e52 < z < 8.5999999999999997e-170

    1. Initial program 97.9%

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

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

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

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

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

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

    if 8.5999999999999997e-170 < z < 3.5000000000000002e-13

    1. Initial program 97.1%

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

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

    if 3.5000000000000002e-13 < z < 1.9500000000000001e125

    1. Initial program 83.4%

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

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

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

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

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

    if 1.9500000000000001e125 < z

    1. Initial program 78.0%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub94.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+52}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{-170}:\\ \;\;\;\;x + y \cdot \frac{t - z}{a}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{-13}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+125}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.7% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 78.3%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.95e52 < z < -1.9999999999999999e-143

    1. Initial program 95.4%

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

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

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

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

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

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

    if -1.9999999999999999e-143 < z < 2.75e66

    1. Initial program 98.1%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out88.1%

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

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

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

    if 2.75e66 < z

    1. Initial program 75.3%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub86.7%

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

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

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

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

Alternative 10: 70.9% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.5e18 or 6.60000000000000029e124 < y

    1. Initial program 73.5%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num97.9%

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr97.9%

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-197.9%

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

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
    9. Taylor expanded in y around inf 81.6%

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)} \]
    10. Step-by-step derivation
      1. div-sub81.6%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
    11. Simplified81.6%

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

    if -5.5e18 < y < 7.5000000000000003e-62

    1. Initial program 100.0%

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

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

    if 7.5000000000000003e-62 < y < 6.60000000000000029e124

    1. Initial program 90.7%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    12. Simplified70.1%

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

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

Alternative 11: 76.3% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.9999999999999999e64 or 2.1e50 < z

    1. Initial program 77.3%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative76.6%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified76.6%

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

    if -9.9999999999999999e64 < z < 6.7999999999999997e-81

    1. Initial program 97.4%

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

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

    if 6.7999999999999997e-81 < z < 2.1e50

    1. Initial program 97.0%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\frac{\color{blue}{-z}}{t}} + x \]
    12. Simplified68.3%

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

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

Alternative 12: 76.2% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.0500000000000001e53 or 4.00000000000000002e41 < z

    1. Initial program 78.3%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative76.7%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified76.7%

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

    if -1.0500000000000001e53 < z < 3.2999999999999999e-31

    1. Initial program 97.6%

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

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

    if 3.2999999999999999e-31 < z < 4.00000000000000002e41

    1. Initial program 94.2%

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

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

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

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

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

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

      \[\leadsto x - \color{blue}{\frac{y \cdot z}{a}} \]
    7. Step-by-step derivation
      1. div-inv59.3%

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

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

        \[\leadsto x - \color{blue}{z \cdot \left(y \cdot \frac{1}{a}\right)} \]
      4. div-inv65.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+53}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{-31}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+41}:\\ \;\;\;\;x - z \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-141}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-13}:\\
\;\;\;\;\frac{-t}{\frac{z}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.00000000000000004e55 or 1.9e-13 < z

    1. Initial program 79.7%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative74.3%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified74.3%

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

    if -4.00000000000000004e55 < z < 4.40000000000000018e-141

    1. Initial program 98.0%

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

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

    if 4.40000000000000018e-141 < z < 1.9e-13

    1. Initial program 96.5%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num86.7%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. inv-pow86.7%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr86.7%

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-186.7%

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

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
    9. Taylor expanded in t around inf 53.7%

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{y}{z - a}} \]
      3. distribute-lft-neg-out56.9%

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

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

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

      \[\leadsto \frac{y}{\color{blue}{z}} \cdot \left(-t\right) \]
    13. Step-by-step derivation
      1. distribute-rgt-neg-out41.2%

        \[\leadsto \color{blue}{-\frac{y}{z} \cdot t} \]
      2. neg-sub041.2%

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

        \[\leadsto 0 - \frac{y}{z} \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)} \]
      4. sqrt-unprod22.7%

        \[\leadsto 0 - \frac{y}{z} \cdot \color{blue}{\sqrt{t \cdot t}} \]
      5. sqr-neg22.7%

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

        \[\leadsto 0 - \frac{y}{z} \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)} \]
      7. add-sqr-sqrt1.7%

        \[\leadsto 0 - \frac{y}{z} \cdot \color{blue}{\left(-t\right)} \]
      8. *-commutative1.7%

        \[\leadsto 0 - \color{blue}{\left(-t\right) \cdot \frac{y}{z}} \]
      9. clear-num1.7%

        \[\leadsto 0 - \left(-t\right) \cdot \color{blue}{\frac{1}{\frac{z}{y}}} \]
      10. un-div-inv1.7%

        \[\leadsto 0 - \color{blue}{\frac{-t}{\frac{z}{y}}} \]
      11. add-sqr-sqrt0.6%

        \[\leadsto 0 - \frac{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}{\frac{z}{y}} \]
      12. sqrt-unprod22.7%

        \[\leadsto 0 - \frac{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{\frac{z}{y}} \]
      13. sqr-neg22.7%

        \[\leadsto 0 - \frac{\sqrt{\color{blue}{t \cdot t}}}{\frac{z}{y}} \]
      14. sqrt-unprod22.3%

        \[\leadsto 0 - \frac{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}{\frac{z}{y}} \]
      15. add-sqr-sqrt41.3%

        \[\leadsto 0 - \frac{\color{blue}{t}}{\frac{z}{y}} \]
    14. Applied egg-rr41.3%

      \[\leadsto \color{blue}{0 - \frac{t}{\frac{z}{y}}} \]
    15. Step-by-step derivation
      1. neg-sub041.3%

        \[\leadsto \color{blue}{-\frac{t}{\frac{z}{y}}} \]
      2. distribute-frac-neg41.3%

        \[\leadsto \color{blue}{\frac{-t}{\frac{z}{y}}} \]
    16. Simplified41.3%

      \[\leadsto \color{blue}{\frac{-t}{\frac{z}{y}}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 61.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-141}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-13}:\\
\;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3999999999999999e51 or 1.9e-13 < z

    1. Initial program 79.7%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative74.3%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified74.3%

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

    if -2.3999999999999999e51 < z < 4.40000000000000018e-141

    1. Initial program 98.0%

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

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

    if 4.40000000000000018e-141 < z < 1.9e-13

    1. Initial program 96.5%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num86.7%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. inv-pow86.7%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    6. Applied egg-rr86.7%

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
    7. Step-by-step derivation
      1. unpow-186.7%

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

      \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
    9. Taylor expanded in t around inf 53.7%

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{y}{z - a}} \]
      3. distribute-lft-neg-out56.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+51}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-141}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-13}:\\ \;\;\;\;\left(-t\right) \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 88.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.89999999999999991 or 8.80000000000000023e-58 < t

    1. Initial program 88.1%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine95.6%

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

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

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

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

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

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

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

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

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

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

    if -2.89999999999999991 < t < 8.80000000000000023e-58

    1. Initial program 89.0%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{z - a}} + x \]
    5. Simplified93.0%

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

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

Alternative 16: 81.1% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.1000000000000001e51 or 1.15999999999999994e-61 < z

    1. Initial program 81.4%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub86.5%

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

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

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

    if -2.1000000000000001e51 < z < 1.15999999999999994e-61

    1. Initial program 97.4%

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

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

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

Alternative 17: 82.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 78.3%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5000000000000001e66 < z < 4.7e-35

    1. Initial program 97.6%

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

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

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

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

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

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

    if 4.7e-35 < z

    1. Initial program 82.0%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub83.0%

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

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

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

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

Alternative 18: 76.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+52} \lor \neg \left(z \leq 3 \cdot 10^{+68}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6e52 or 3.0000000000000002e68 < z

    1. Initial program 76.7%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative76.8%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified76.8%

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

    if -1.6e52 < z < 3.0000000000000002e68

    1. Initial program 97.3%

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

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

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

Alternative 19: 64.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+51} \lor \neg \left(z \leq 5.5 \cdot 10^{-63}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.39999999999999984e51 or 5.50000000000000043e-63 < z

    1. Initial program 81.4%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative70.1%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified70.1%

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

    if -4.39999999999999984e51 < z < 5.50000000000000043e-63

    1. Initial program 97.4%

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

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

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

Alternative 20: 54.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+213}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+131}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.02e213 or 2.9000000000000001e131 < y

    1. Initial program 65.8%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative34.8%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified34.8%

      \[\leadsto \color{blue}{y + x} \]
    6. Taylor expanded in y around inf 34.8%

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{x}{y} + 1\right)} \]
    8. Simplified34.8%

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} + 1\right)} \]
    9. Taylor expanded in x around 0 30.5%

      \[\leadsto y \cdot \color{blue}{1} \]

    if -1.02e213 < y < 2.9000000000000001e131

    1. Initial program 95.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+213}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+131}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 52.2% 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 88.6%

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

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

Developer Target 1: 98.1% 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 2024135 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

  :alt
  (! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))

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