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

Percentage Accurate: 76.8% → 85.7%
Time: 11.6s
Alternatives: 12
Speedup: 0.7×

Specification

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

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

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

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

Alternative 1: 85.7% accurate, 0.1× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(y + x\right) + y \cdot t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.3999999999999998e-59

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\left(-z\right) + \left(-\left(-t\right)\right)}}{a - t}, y, x + y\right) \]
      12. remove-double-neg94.0%

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

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

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

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

    if -5.3999999999999998e-59 < a < 9.5000000000000003e29

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.5000000000000003e29 < a

    1. Initial program 82.5%

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

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

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

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

Alternative 2: 59.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.7 \cdot 10^{-221}:\\
\;\;\;\;y + x\\

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-197}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.69999999999999985e-221 or 5.1000000000000001e-54 < a

    1. Initial program 79.7%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified73.8%

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

    if -3.69999999999999985e-221 < a < -1.99999999999999982e-298

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999982e-298 < a < 9.5000000000000003e-197

    1. Initial program 73.4%

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

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

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

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

    if 9.5000000000000003e-197 < a < 5.1000000000000001e-54

    1. Initial program 60.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a \cdot y}{t} + \frac{y \cdot z}{t}} \]
    13. Step-by-step derivation
      1. mul-1-neg46.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} - \frac{a}{t} \cdot y \]
      7. associate-*r/55.7%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} - \frac{a}{t} \cdot y \]
      8. *-commutative55.7%

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

        \[\leadsto \color{blue}{y \cdot \left(\frac{z}{t} - \frac{a}{t}\right)} \]
      10. div-sub55.7%

        \[\leadsto y \cdot \color{blue}{\frac{z - a}{t}} \]
      11. associate-*r/46.1%

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

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

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

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

Alternative 3: 85.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.69999999999999994e-58 or 9.4999999999999997e27 < a

    1. Initial program 81.2%

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

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

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

    if -4.69999999999999994e-58 < a < 9.4999999999999997e27

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2e-47 or 2.75e-74 < a

    1. Initial program 78.3%

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

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

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

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

    if -1.2e-47 < a < 2.75e-74

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.0% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.1999999999999999e-57

    1. Initial program 80.0%

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

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

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

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

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

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

    if -4.1999999999999999e-57 < a < 4.29999999999999972e-74

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.29999999999999972e-74 < a

    1. Initial program 78.3%

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

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

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

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

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

Alternative 6: 83.2% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.5000000000000004e-58

    1. Initial program 80.0%

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

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

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

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

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

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

    if -8.5000000000000004e-58 < a < 3.99999999999999983e28

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999983e28 < a

    1. Initial program 82.5%

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

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

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

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

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

Alternative 7: 61.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{-221}:\\
\;\;\;\;y + x\\

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{+27}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.5000000000000001e-221 or 9.4999999999999997e27 < a

    1. Initial program 81.6%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified75.8%

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

    if -1.5000000000000001e-221 < a < -1.2000000000000001e-299

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2000000000000001e-299 < a < 9.4999999999999997e27

    1. Initial program 62.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.5 \cdot 10^{-221}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-299}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+27}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 61.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-221}:\\
\;\;\;\;y + x\\

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

\mathbf{elif}\;a \leq 1.15 \cdot 10^{+29}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.49999999999999998e-221 or 1.1500000000000001e29 < a

    1. Initial program 81.6%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified75.8%

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

    if -2.49999999999999998e-221 < a < -4.2000000000000001e-298

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000001e-298 < a < 1.1500000000000001e29

    1. Initial program 62.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{-221}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;a \leq -4.2 \cdot 10^{-298}:\\ \;\;\;\;\frac{z \cdot y}{t}\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{+29}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{-35} \lor \neg \left(a \leq 3.55 \cdot 10^{-31}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.00000000000000003e-35 or 3.5499999999999999e-31 < a

    1. Initial program 78.4%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified80.4%

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

    if -4.00000000000000003e-35 < a < 3.5499999999999999e-31

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 62.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{-59} \lor \neg \left(a \leq 9.5 \cdot 10^{+27}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.90000000000000016e-59 or 9.4999999999999997e27 < a

    1. Initial program 81.3%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified80.4%

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

    if -2.90000000000000016e-59 < a < 9.4999999999999997e27

    1. Initial program 69.4%

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

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

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

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

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

Alternative 11: 51.2% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{+88}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.99999999999999992e88

    1. Initial program 80.6%

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

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

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

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

    if 1.99999999999999992e88 < y

    1. Initial program 49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2 \cdot 10^{+88}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 49.8% accurate, 13.0× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification50.8%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 88.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_2 < 1.4754293444577233 \cdot 10^{-239}:\\
\;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-7) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))

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