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

Percentage Accurate: 85.2% → 99.6%
Time: 14.9s
Alternatives: 23
Speedup: 0.5×

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 23 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.2% 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.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 + \left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+307}:\\ \;\;\;\;x + t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\frac{z - t}{z - a} + \frac{x}{y}\right)\\ \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) (/ y (- z a))))
     (if (<= t_1 4e+307) (+ x t_1) (* y (+ (/ (- z t) (- z a)) (/ x y)))))))
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) * (y / (z - a)));
	} else if (t_1 <= 4e+307) {
		tmp = x + t_1;
	} else {
		tmp = y * (((z - t) / (z - a)) + (x / y));
	}
	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) * (y / (z - a)));
	} else if (t_1 <= 4e+307) {
		tmp = x + t_1;
	} else {
		tmp = y * (((z - t) / (z - a)) + (x / y));
	}
	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) * (y / (z - a)))
	elif t_1 <= 4e+307:
		tmp = x + t_1
	else:
		tmp = y * (((z - t) / (z - a)) + (x / y))
	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(y / Float64(z - a))));
	elseif (t_1 <= 4e+307)
		tmp = Float64(x + t_1);
	else
		tmp = Float64(y * Float64(Float64(Float64(z - t) / Float64(z - a)) + Float64(x / y)));
	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) * (y / (z - a)));
	elseif (t_1 <= 4e+307)
		tmp = x + t_1;
	else
		tmp = y * (((z - t) / (z - a)) + (x / y));
	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[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+307], N[(x + t$95$1), $MachinePrecision], N[(y * N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + N[(x / y), $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 + \left(z - t\right) \cdot \frac{y}{z - a}\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;x + t\_1\\

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


\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 36.0%

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

        \[\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. fma-undefine99.7%

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

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

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

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

        \[\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} \]

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 3.99999999999999994e307

    1. Initial program 98.7%

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

    if 3.99999999999999994e307 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 40.0%

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

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

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

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

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

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

Alternative 2: 98.3% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

Alternative 3: 96.7% 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^{+300} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+307}\right):\\ \;\;\;\;\frac{y}{\frac{z - a}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + t\_1\\ \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+300) (not (<= t_1 4e+307)))
     (/ y (/ (- z a) (- z t)))
     (+ x 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 ((t_1 <= -5e+300) || !(t_1 <= 4e+307)) {
		tmp = y / ((z - a) / (z - t));
	} else {
		tmp = x + 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 ((t_1 <= (-5d+300)) .or. (.not. (t_1 <= 4d+307))) then
        tmp = y / ((z - a) / (z - t))
    else
        tmp = x + 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 ((t_1 <= -5e+300) || !(t_1 <= 4e+307)) {
		tmp = y / ((z - a) / (z - t));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if (t_1 <= -5e+300) or not (t_1 <= 4e+307):
		tmp = y / ((z - a) / (z - t))
	else:
		tmp = x + t_1
	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+300) || !(t_1 <= 4e+307))
		tmp = Float64(y / Float64(Float64(z - a) / Float64(z - t)));
	else
		tmp = Float64(x + 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 ((t_1 <= -5e+300) || ~((t_1 <= 4e+307)))
		tmp = y / ((z - a) / (z - t));
	else
		tmp = x + t_1;
	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+300], N[Not[LessEqual[t$95$1, 4e+307]], $MachinePrecision]], N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $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^{+300} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+307}\right):\\
\;\;\;\;\frac{y}{\frac{z - a}{z - t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -5.00000000000000026e300 or 3.99999999999999994e307 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 40.1%

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

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

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} \]
      2. clear-num90.0%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
      3. un-div-inv90.1%

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

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

    if -5.00000000000000026e300 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 3.99999999999999994e307

    1. Initial program 98.7%

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

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

Alternative 4: 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 4 \cdot 10^{+307}\right):\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + t\_1\\ \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 4e+307)))
     (+ x (* (- z t) (/ y (- z a))))
     (+ x 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 ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+307)) {
		tmp = x + ((z - t) * (y / (z - a)));
	} else {
		tmp = x + t_1;
	}
	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 <= 4e+307)) {
		tmp = x + ((z - t) * (y / (z - a)));
	} else {
		tmp = x + t_1;
	}
	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 <= 4e+307):
		tmp = x + ((z - t) * (y / (z - a)))
	else:
		tmp = x + t_1
	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 <= 4e+307))
		tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a))));
	else
		tmp = Float64(x + 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 ((t_1 <= -Inf) || ~((t_1 <= 4e+307)))
		tmp = x + ((z - t) * (y / (z - a)));
	else
		tmp = x + t_1;
	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, 4e+307]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $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 4 \cdot 10^{+307}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\

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


\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 3.99999999999999994e307 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 38.2%

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

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

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

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

      \[\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.8%

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

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

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

        \[\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.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)) < 3.99999999999999994e307

    1. Initial program 98.7%

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

    \[\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 4 \cdot 10^{+307}\right):\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 61.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-253}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.12 \cdot 10^{-153}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.48 \cdot 10^{-118}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.2000000000000001e-18 or 1.4800000000000001e-118 < z

    1. Initial program 76.5%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified72.0%

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

    if -5.2000000000000001e-18 < z < -1.0499999999999999e-253 or 5.8e-278 < z < 1.12000000000000005e-153 or 1.15e-133 < z < 1.4800000000000001e-118

    1. Initial program 93.6%

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

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

    if -1.0499999999999999e-253 < z < 5.8e-278

    1. Initial program 93.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/82.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg281.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{-\left(z - a\right)}} \]
      5. sub-neg69.6%

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

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

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

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

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

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

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

    if 1.12000000000000005e-153 < z < 1.15e-133

    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*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-num100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/99.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    8. Step-by-step derivation
      1. mul-1-neg78.9%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg278.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{\color{blue}{-t}}{z} \]
    12. Simplified68.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-18}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-253}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-278}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.12 \cdot 10^{-153}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-133}:\\ \;\;\;\;y \cdot \frac{-t}{z}\\ \mathbf{elif}\;z \leq 1.48 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 61.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{-18}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-254}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-271}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-154}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-132}:\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{z}\\ \mathbf{elif}\;z \leq 1.88 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.9e-18)
   (+ y x)
   (if (<= z -9.2e-254)
     x
     (if (<= z 3.2e-271)
       (/ (* y t) a)
       (if (<= z 1.32e-154)
         x
         (if (<= z 1.85e-132)
           (/ (* y (- t)) z)
           (if (<= z 1.88e-118) x (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.9e-18) {
		tmp = y + x;
	} else if (z <= -9.2e-254) {
		tmp = x;
	} else if (z <= 3.2e-271) {
		tmp = (y * t) / a;
	} else if (z <= 1.32e-154) {
		tmp = x;
	} else if (z <= 1.85e-132) {
		tmp = (y * -t) / z;
	} else if (z <= 1.88e-118) {
		tmp = x;
	} 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.9d-18)) then
        tmp = y + x
    else if (z <= (-9.2d-254)) then
        tmp = x
    else if (z <= 3.2d-271) then
        tmp = (y * t) / a
    else if (z <= 1.32d-154) then
        tmp = x
    else if (z <= 1.85d-132) then
        tmp = (y * -t) / z
    else if (z <= 1.88d-118) then
        tmp = x
    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.9e-18) {
		tmp = y + x;
	} else if (z <= -9.2e-254) {
		tmp = x;
	} else if (z <= 3.2e-271) {
		tmp = (y * t) / a;
	} else if (z <= 1.32e-154) {
		tmp = x;
	} else if (z <= 1.85e-132) {
		tmp = (y * -t) / z;
	} else if (z <= 1.88e-118) {
		tmp = x;
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.9e-18:
		tmp = y + x
	elif z <= -9.2e-254:
		tmp = x
	elif z <= 3.2e-271:
		tmp = (y * t) / a
	elif z <= 1.32e-154:
		tmp = x
	elif z <= 1.85e-132:
		tmp = (y * -t) / z
	elif z <= 1.88e-118:
		tmp = x
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.9e-18)
		tmp = Float64(y + x);
	elseif (z <= -9.2e-254)
		tmp = x;
	elseif (z <= 3.2e-271)
		tmp = Float64(Float64(y * t) / a);
	elseif (z <= 1.32e-154)
		tmp = x;
	elseif (z <= 1.85e-132)
		tmp = Float64(Float64(y * Float64(-t)) / z);
	elseif (z <= 1.88e-118)
		tmp = x;
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.9e-18)
		tmp = y + x;
	elseif (z <= -9.2e-254)
		tmp = x;
	elseif (z <= 3.2e-271)
		tmp = (y * t) / a;
	elseif (z <= 1.32e-154)
		tmp = x;
	elseif (z <= 1.85e-132)
		tmp = (y * -t) / z;
	elseif (z <= 1.88e-118)
		tmp = x;
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-18], N[(y + x), $MachinePrecision], If[LessEqual[z, -9.2e-254], x, If[LessEqual[z, 3.2e-271], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 1.32e-154], x, If[LessEqual[z, 1.85e-132], N[(N[(y * (-t)), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 1.88e-118], x, N[(y + x), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9.2 \cdot 10^{-254}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.32 \cdot 10^{-154}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 1.88 \cdot 10^{-118}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.8999999999999999e-18 or 1.88000000000000001e-118 < z

    1. Initial program 76.5%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified72.0%

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

    if -1.8999999999999999e-18 < z < -9.1999999999999995e-254 or 3.19999999999999978e-271 < z < 1.31999999999999994e-154 or 1.8500000000000001e-132 < z < 1.88000000000000001e-118

    1. Initial program 93.6%

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

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

    if -9.1999999999999995e-254 < z < 3.19999999999999978e-271

    1. Initial program 93.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/82.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg281.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{-\left(z - a\right)}} \]
      5. sub-neg69.6%

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

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

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

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

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

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

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

    if 1.31999999999999994e-154 < z < 1.8500000000000001e-132

    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*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-num100.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/99.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    8. Step-by-step derivation
      1. mul-1-neg78.9%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg278.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(t \cdot y\right)}{z}} \]
      2. *-commutative68.9%

        \[\leadsto \frac{-1 \cdot \color{blue}{\left(y \cdot t\right)}}{z} \]
      3. neg-mul-168.9%

        \[\leadsto \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in68.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{-18}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-254}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-271}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-154}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-132}:\\ \;\;\;\;\frac{y \cdot \left(-t\right)}{z}\\ \mathbf{elif}\;z \leq 1.88 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 58.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(1 - \frac{t}{z}\right)\\ t_2 := t \cdot \frac{y}{a - z}\\ \mathbf{if}\;x \leq -1.02 \cdot 10^{-141}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq -5.4 \cdot 10^{-186}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-254}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-231}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-14}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (- 1.0 (/ t z)))) (t_2 (* t (/ y (- a z)))))
   (if (<= x -1.02e-141)
     (+ y x)
     (if (<= x -5.4e-186)
       t_2
       (if (<= x -2.3e-254)
         t_1
         (if (<= x 5.5e-231) t_2 (if (<= x 5e-14) t_1 (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (1.0 - (t / z));
	double t_2 = t * (y / (a - z));
	double tmp;
	if (x <= -1.02e-141) {
		tmp = y + x;
	} else if (x <= -5.4e-186) {
		tmp = t_2;
	} else if (x <= -2.3e-254) {
		tmp = t_1;
	} else if (x <= 5.5e-231) {
		tmp = t_2;
	} else if (x <= 5e-14) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * (1.0d0 - (t / z))
    t_2 = t * (y / (a - z))
    if (x <= (-1.02d-141)) then
        tmp = y + x
    else if (x <= (-5.4d-186)) then
        tmp = t_2
    else if (x <= (-2.3d-254)) then
        tmp = t_1
    else if (x <= 5.5d-231) then
        tmp = t_2
    else if (x <= 5d-14) then
        tmp = t_1
    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 t_1 = y * (1.0 - (t / z));
	double t_2 = t * (y / (a - z));
	double tmp;
	if (x <= -1.02e-141) {
		tmp = y + x;
	} else if (x <= -5.4e-186) {
		tmp = t_2;
	} else if (x <= -2.3e-254) {
		tmp = t_1;
	} else if (x <= 5.5e-231) {
		tmp = t_2;
	} else if (x <= 5e-14) {
		tmp = t_1;
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (1.0 - (t / z))
	t_2 = t * (y / (a - z))
	tmp = 0
	if x <= -1.02e-141:
		tmp = y + x
	elif x <= -5.4e-186:
		tmp = t_2
	elif x <= -2.3e-254:
		tmp = t_1
	elif x <= 5.5e-231:
		tmp = t_2
	elif x <= 5e-14:
		tmp = t_1
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(1.0 - Float64(t / z)))
	t_2 = Float64(t * Float64(y / Float64(a - z)))
	tmp = 0.0
	if (x <= -1.02e-141)
		tmp = Float64(y + x);
	elseif (x <= -5.4e-186)
		tmp = t_2;
	elseif (x <= -2.3e-254)
		tmp = t_1;
	elseif (x <= 5.5e-231)
		tmp = t_2;
	elseif (x <= 5e-14)
		tmp = t_1;
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (1.0 - (t / z));
	t_2 = t * (y / (a - z));
	tmp = 0.0;
	if (x <= -1.02e-141)
		tmp = y + x;
	elseif (x <= -5.4e-186)
		tmp = t_2;
	elseif (x <= -2.3e-254)
		tmp = t_1;
	elseif (x <= 5.5e-231)
		tmp = t_2;
	elseif (x <= 5e-14)
		tmp = t_1;
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.02e-141], N[(y + x), $MachinePrecision], If[LessEqual[x, -5.4e-186], t$95$2, If[LessEqual[x, -2.3e-254], t$95$1, If[LessEqual[x, 5.5e-231], t$95$2, If[LessEqual[x, 5e-14], t$95$1, N[(y + x), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -5.4 \cdot 10^{-186}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -2.3 \cdot 10^{-254}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{-231}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 5 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.02e-141 or 5.0000000000000002e-14 < x

    1. Initial program 86.3%

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

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

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

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

    if -1.02e-141 < x < -5.3999999999999998e-186 or -2.2999999999999999e-254 < x < 5.49999999999999951e-231

    1. Initial program 81.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/94.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    8. Step-by-step derivation
      1. mul-1-neg51.4%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg251.4%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{-\left(z - a\right)}} \]
      5. sub-neg60.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a - z}} \]
    12. Simplified60.2%

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

    if -5.3999999999999998e-186 < x < -2.2999999999999999e-254 or 5.49999999999999951e-231 < x < 5.0000000000000002e-14

    1. Initial program 78.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.02 \cdot 10^{-141}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;x \leq -5.4 \cdot 10^{-186}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-254}:\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-231}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-14}:\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 61.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{a}\\ \mathbf{if}\;z \leq -1.02 \cdot 10^{-8}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-254}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-265}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-165}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-133}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t a))))
   (if (<= z -1.02e-8)
     (+ y x)
     (if (<= z -2.9e-254)
       x
       (if (<= z 1.22e-265)
         t_1
         (if (<= z 6.2e-165) x (if (<= z 7.2e-133) t_1 (+ y x))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double tmp;
	if (z <= -1.02e-8) {
		tmp = y + x;
	} else if (z <= -2.9e-254) {
		tmp = x;
	} else if (z <= 1.22e-265) {
		tmp = t_1;
	} else if (z <= 6.2e-165) {
		tmp = x;
	} else if (z <= 7.2e-133) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = y * (t / a)
    if (z <= (-1.02d-8)) then
        tmp = y + x
    else if (z <= (-2.9d-254)) then
        tmp = x
    else if (z <= 1.22d-265) then
        tmp = t_1
    else if (z <= 6.2d-165) then
        tmp = x
    else if (z <= 7.2d-133) then
        tmp = t_1
    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 t_1 = y * (t / a);
	double tmp;
	if (z <= -1.02e-8) {
		tmp = y + x;
	} else if (z <= -2.9e-254) {
		tmp = x;
	} else if (z <= 1.22e-265) {
		tmp = t_1;
	} else if (z <= 6.2e-165) {
		tmp = x;
	} else if (z <= 7.2e-133) {
		tmp = t_1;
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / a)
	tmp = 0
	if z <= -1.02e-8:
		tmp = y + x
	elif z <= -2.9e-254:
		tmp = x
	elif z <= 1.22e-265:
		tmp = t_1
	elif z <= 6.2e-165:
		tmp = x
	elif z <= 7.2e-133:
		tmp = t_1
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / a))
	tmp = 0.0
	if (z <= -1.02e-8)
		tmp = Float64(y + x);
	elseif (z <= -2.9e-254)
		tmp = x;
	elseif (z <= 1.22e-265)
		tmp = t_1;
	elseif (z <= 6.2e-165)
		tmp = x;
	elseif (z <= 7.2e-133)
		tmp = t_1;
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / a);
	tmp = 0.0;
	if (z <= -1.02e-8)
		tmp = y + x;
	elseif (z <= -2.9e-254)
		tmp = x;
	elseif (z <= 1.22e-265)
		tmp = t_1;
	elseif (z <= 6.2e-165)
		tmp = x;
	elseif (z <= 7.2e-133)
		tmp = t_1;
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.02e-8], N[(y + x), $MachinePrecision], If[LessEqual[z, -2.9e-254], x, If[LessEqual[z, 1.22e-265], t$95$1, If[LessEqual[z, 6.2e-165], x, If[LessEqual[z, 7.2e-133], t$95$1, N[(y + x), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-254}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.22 \cdot 10^{-265}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{-165}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.02000000000000003e-8 or 7.2000000000000008e-133 < z

    1. Initial program 77.1%

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

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

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

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

    if -1.02000000000000003e-8 < z < -2.9e-254 or 1.22e-265 < z < 6.19999999999999992e-165

    1. Initial program 93.4%

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

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

    if -2.9e-254 < z < 1.22e-265 or 6.19999999999999992e-165 < z < 7.2000000000000008e-133

    1. Initial program 95.8%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified91.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-num91.9%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/91.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    8. Step-by-step derivation
      1. mul-1-neg79.9%

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg279.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{-8}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-254}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.22 \cdot 10^{-265}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{-165}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-133}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-142} \lor \neg \left(x \leq 4.8 \cdot 10^{-196}\right) \land \left(x \leq 1.4 \cdot 10^{-151} \lor \neg \left(x \leq 1.02 \cdot 10^{-116}\right)\right):\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3e-142 or 4.80000000000000041e-196 < x < 1.4e-151 or 1.02e-116 < x

    1. Initial program 86.9%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified97.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-num97.8%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/97.7%

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

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

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

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

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

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

    if -1.3e-142 < x < 4.80000000000000041e-196 or 1.4e-151 < x < 1.02e-116

    1. Initial program 76.4%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/95.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{-142} \lor \neg \left(x \leq 4.8 \cdot 10^{-196}\right) \land \left(x \leq 1.4 \cdot 10^{-151} \lor \neg \left(x \leq 1.02 \cdot 10^{-116}\right)\right):\\ \;\;\;\;x + z \cdot \frac{y}{z - a}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 76.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-196} \lor \neg \left(x \leq 5.3 \cdot 10^{-153}\right) \land x \leq 3.3 \cdot 10^{-115}:\\
\;\;\;\;y \cdot \frac{z - t}{z - a}\\

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


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

    1. Initial program 86.5%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/98.9%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{z - a} \cdot z} \]
      2. *-commutative82.9%

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

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

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

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

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

    if -4.29999999999999974e-141 < x < 4.80000000000000041e-196 or 5.2999999999999997e-153 < x < 3.2999999999999999e-115

    1. Initial program 76.4%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/95.9%

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

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

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

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

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

    if 4.80000000000000041e-196 < x < 5.2999999999999997e-153 or 3.2999999999999999e-115 < x

    1. Initial program 87.3%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/96.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{z}{\frac{z - a}{y}}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-196} \lor \neg \left(x \leq 5.3 \cdot 10^{-153}\right) \land x \leq 3.3 \cdot 10^{-115}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 77.7% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \leq 7.6 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \frac{z - t}{z - a}\\

\mathbf{elif}\;a \leq 9 \cdot 10^{+216}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.09999999999999972e61 or 7.5999999999999999e61 < a < 9.0000000000000005e216

    1. Initial program 81.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/97.4%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{z - a} \cdot z} \]
      2. *-commutative82.8%

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

      \[\leadsto \color{blue}{x + z \cdot \frac{y}{z - a}} \]
    10. Step-by-step derivation
      1. clear-num82.8%

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

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

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

    if -4.09999999999999972e61 < a < 2.09999999999999989e-13

    1. Initial program 86.2%

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

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

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

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

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

    if 2.09999999999999989e-13 < a < 7.5999999999999999e61

    1. Initial program 79.8%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified99.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-num99.6%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/99.4%

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

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

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

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

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

    if 9.0000000000000005e216 < a

    1. Initial program 77.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.1 \cdot 10^{+61}:\\ \;\;\;\;x + \frac{z}{\frac{z - a}{y}}\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{-13}:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{+61}:\\ \;\;\;\;y \cdot \frac{z - t}{z - a}\\ \mathbf{elif}\;a \leq 9 \cdot 10^{+216}:\\ \;\;\;\;x + \frac{z}{\frac{z - a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 59.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.36 \cdot 10^{-142} \lor \neg \left(x \leq 6.8 \cdot 10^{-215}\right) \land \left(x \leq 5.3 \cdot 10^{-186} \lor \neg \left(x \leq 1.3 \cdot 10^{-72}\right)\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.35999999999999993e-142 or 6.80000000000000003e-215 < x < 5.30000000000000022e-186 or 1.29999999999999998e-72 < x

    1. Initial program 84.0%

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

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

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

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

    if -1.35999999999999993e-142 < x < 6.80000000000000003e-215 or 5.30000000000000022e-186 < x < 1.29999999999999998e-72

    1. Initial program 82.8%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    3. Simplified93.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-num92.8%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/93.5%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    8. Step-by-step derivation
      1. mul-1-neg45.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.36 \cdot 10^{-142} \lor \neg \left(x \leq 6.8 \cdot 10^{-215}\right) \land \left(x \leq 5.3 \cdot 10^{-186} \lor \neg \left(x \leq 1.3 \cdot 10^{-72}\right)\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 87.2% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 57.6%

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

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

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

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

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

    if -9.8000000000000006e187 < z < -8.99999999999999986e-8

    1. Initial program 83.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative83.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. clear-num99.9%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/99.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{z - a} \cdot z} \]
      2. *-commutative89.8%

        \[\leadsto x + \color{blue}{z \cdot \frac{y}{z - a}} \]
    9. Simplified89.8%

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

    if -8.99999999999999986e-8 < z < 4.1000000000000002e27

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \left(-\frac{y}{z - a}\right) \cdot t} \]
      10. distribute-frac-neg45.9%

        \[\leadsto x - \color{blue}{\frac{-y}{z - a}} \cdot t \]
      11. *-commutative45.9%

        \[\leadsto x - \color{blue}{t \cdot \frac{-y}{z - a}} \]
      12. clear-num45.9%

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

        \[\leadsto x - \color{blue}{\frac{t}{\frac{z - a}{-y}}} \]
      14. add-sqr-sqrt22.2%

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

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

        \[\leadsto x - \frac{t}{\frac{z - a}{\sqrt{\color{blue}{y \cdot y}}}} \]
      17. sqrt-unprod42.0%

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

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

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

    if 4.1000000000000002e27 < z

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.8 \cdot 10^{+187}:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-8}:\\ \;\;\;\;x + z \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+27}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{z}{t - z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 62.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -1.18 \cdot 10^{-253}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq 2.7 \cdot 10^{-118}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.0000000000000003e-15 or 2.69999999999999994e-118 < z

    1. Initial program 76.5%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified72.0%

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

    if -4.0000000000000003e-15 < z < -1.1799999999999999e-253 or 3.5999999999999997e-275 < z < 2.69999999999999994e-118

    1. Initial program 94.2%

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

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

    if -1.1799999999999999e-253 < z < 3.5999999999999997e-275

    1. Initial program 93.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/82.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg281.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{-\left(z - a\right)}} \]
      5. sub-neg69.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    12. Simplified63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{-15}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -1.18 \cdot 10^{-253}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{-275}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 62.4% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 1.88 \cdot 10^{-118}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.1500000000000001e-12 or 1.88000000000000001e-118 < z

    1. Initial program 76.5%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified72.0%

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

    if -3.1500000000000001e-12 < z < -1.59999999999999991e-251 or 2.14999999999999988e-275 < z < 1.88000000000000001e-118

    1. Initial program 94.2%

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

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

    if -1.59999999999999991e-251 < z < 2.14999999999999988e-275

    1. Initial program 93.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/82.1%

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot y}{z - a}} \]
      2. distribute-frac-neg281.7%

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

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{-\left(z - a\right)}} \]
      5. sub-neg69.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.15 \cdot 10^{-12}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-251}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-275}:\\ \;\;\;\;\frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 1.88 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 71.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.92 \cdot 10^{+84} \lor \neg \left(y \leq 22\right):\\
\;\;\;\;y \cdot \frac{z - t}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.91999999999999993e84 or 22 < y

    1. Initial program 70.7%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{\frac{1}{\frac{z - a}{z - t}}}, x\right) \]
      2. associate-/r/97.2%

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

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

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

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

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

    if -1.91999999999999993e84 < y < 22

    1. Initial program 95.4%

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

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

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

Alternative 17: 81.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9e61 or 1060 < a

    1. Initial program 80.7%

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

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

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

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

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

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

    if -9e61 < a < 1060

    1. Initial program 85.9%

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

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

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

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

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

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

Alternative 18: 75.5% accurate, 0.6× speedup?

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

    1. Initial program 73.6%

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

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

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

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

    if -4.1e5 < z < 8.5999999999999999e-53

    1. Initial program 95.0%

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

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

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

Alternative 19: 76.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -24.5 \lor \neg \left(z \leq 3.5 \cdot 10^{-6}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -24.5 or 3.49999999999999995e-6 < z

    1. Initial program 73.4%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified77.2%

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

    if -24.5 < z < 3.49999999999999995e-6

    1. Initial program 93.8%

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

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

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

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

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

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

Alternative 20: 76.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3300 \lor \neg \left(z \leq 1.3 \cdot 10^{-5}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3300 or 1.29999999999999992e-5 < z

    1. Initial program 73.4%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified77.2%

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

    if -3300 < z < 1.29999999999999992e-5

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

Alternative 21: 62.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-13} \lor \neg \left(z \leq 1.55 \cdot 10^{-118}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.0000000000000002e-13 or 1.5500000000000001e-118 < z

    1. Initial program 76.5%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified72.0%

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

    if -8.0000000000000002e-13 < z < 1.5500000000000001e-118

    1. Initial program 94.2%

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

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

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

Alternative 22: 52.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1.48 \cdot 10^{+156}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.10000000000000029e163 or 1.4799999999999999e156 < y

    1. Initial program 59.8%

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

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

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

    if -3.10000000000000029e163 < y < 1.4799999999999999e156

    1. Initial program 92.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+163}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.48 \cdot 10^{+156}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 49.7% accurate, 11.0× speedup?

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification47.5%

    \[\leadsto x \]
  5. Add Preprocessing

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

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

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