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

Percentage Accurate: 77.2% → 90.4%
Time: 10.8s
Alternatives: 13
Speedup: 0.6×

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 13 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: 77.2% 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: 90.4% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.9999999999999999e107

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9999999999999999e107 < t < 2.79999999999999982e84

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

    if 2.79999999999999982e84 < t

    1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 77.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{+24} \lor \neg \left(a \leq -3.8 \cdot 10^{-33}\right) \land \left(a \leq -4.1 \cdot 10^{-70} \lor \neg \left(a \leq 6.5 \cdot 10^{+83}\right)\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.12e24 or -3.79999999999999994e-33 < a < -4.09999999999999977e-70 or 6.5000000000000003e83 < a

    1. Initial program 87.2%

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

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

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

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

    if -1.12e24 < a < -3.79999999999999994e-33 or -4.09999999999999977e-70 < a < 6.5000000000000003e83

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.12 \cdot 10^{+24} \lor \neg \left(a \leq -3.8 \cdot 10^{-33}\right) \land \left(a \leq -4.1 \cdot 10^{-70} \lor \neg \left(a \leq 6.5 \cdot 10^{+83}\right)\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot \left(a - z\right)}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.95 \cdot 10^{+23} \lor \neg \left(a \leq -1.08 \cdot 10^{-33} \lor \neg \left(a \leq -1.3 \cdot 10^{-68}\right) \land a \leq 8.5 \cdot 10^{+83}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.94999999999999994e23 or -1.08000000000000007e-33 < a < -1.2999999999999999e-68 or 8.4999999999999995e83 < a

    1. Initial program 87.2%

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

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

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

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

    if -2.94999999999999994e23 < a < -1.08000000000000007e-33 or -1.2999999999999999e-68 < a < 8.4999999999999995e83

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -7.3 \cdot 10^{-23}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq -5.8 \cdot 10^{-58}:\\
\;\;\;\;x + t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -8.9999999999999994e106

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.9999999999999994e106 < t < -7.30000000000000005e-23

    1. Initial program 90.4%

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

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

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

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

    if -7.30000000000000005e-23 < t < -5.7999999999999998e-58

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.7999999999999998e-58 < t < 3.5999999999999999e-28

    1. Initial program 95.3%

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

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

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

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

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

    if 3.5999999999999999e-28 < t

    1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -6 \cdot 10^{-18}:\\
\;\;\;\;x + y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.6e105 or 1.79999999999999987e-29 < t

    1. Initial program 65.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{a \cdot y - \color{blue}{z \cdot y}}{t} \]
      4. cancel-sign-sub-inv79.8%

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

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

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

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

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

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

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

    if -1.6e105 < t < -5.99999999999999966e-18

    1. Initial program 90.4%

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

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

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

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

    if -5.99999999999999966e-18 < t < -1.5e-57

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e-57 < t < 1.79999999999999987e-29

    1. Initial program 95.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{+105}:\\ \;\;\;\;x - y \cdot \frac{a - z}{t}\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-18}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -1.5 \cdot 10^{-57}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-29}:\\ \;\;\;\;\left(x + y\right) - y \cdot \frac{z}{a}\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \frac{a - z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 62.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+112}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq -4.4 \cdot 10^{-256}:\\
\;\;\;\;x + y\\

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

\mathbf{elif}\;t \leq 7.7 \cdot 10^{+84}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.19999999999999951e112 or 7.7000000000000003e84 < t

    1. Initial program 62.3%

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

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

    if -8.19999999999999951e112 < t < -4.4000000000000002e-256 or 8.00000000000000044e-279 < t < 7.7000000000000003e84

    1. Initial program 93.4%

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \]
    2. Add Preprocessing
    3. Taylor expanded in a 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 -4.4000000000000002e-256 < t < 8.00000000000000044e-279

    1. Initial program 94.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{+112}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq -4.4 \cdot 10^{-256}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-279}:\\ \;\;\;\;y \cdot \left(1 - \frac{z}{a}\right)\\ \mathbf{elif}\;t \leq 7.7 \cdot 10^{+84}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 90.2% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.05000000000000005e105

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05000000000000005e105 < t < 8.8000000000000001e45

    1. Initial program 93.8%

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

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

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

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

    if 8.8000000000000001e45 < t

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{a \cdot y - \color{blue}{z \cdot y}}{t} \]
      4. cancel-sign-sub-inv77.6%

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{a + -1 \cdot z}{t}} \]
      8. mul-1-neg87.0%

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

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

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

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

Alternative 8: 76.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\neg \left(a \leq -1.3 \cdot 10^{-68}\right) \land a \leq 3.4 \cdot 10^{-30}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2999999999999999e-68 or 3.4000000000000003e-30 < a

    1. Initial program 81.9%

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

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

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

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

    if -1.2999999999999999e-68 < a < 3.4000000000000003e-30

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    11. Simplified84.9%

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

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

Alternative 9: 63.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+241} \lor \neg \left(z \leq 8.5 \cdot 10^{+223}\right):\\
\;\;\;\;z \cdot \frac{y}{t - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.49999999999999993e241 or 8.5000000000000005e223 < z

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.49999999999999993e241 < z < 8.5000000000000005e223

    1. Initial program 81.3%

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

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

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

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

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

Alternative 10: 63.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;x\\

\mathbf{elif}\;t \leq 1.95 \cdot 10^{+84}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.85000000000000002e112 or 1.95000000000000008e84 < t

    1. Initial program 62.3%

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

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

    if -1.85000000000000002e112 < t < 1.95000000000000008e84

    1. Initial program 93.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+112}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{+84}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 62.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 8.7 \cdot 10^{+223}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 8.7000000000000001e223

    1. Initial program 81.2%

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

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

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

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

    if 8.7000000000000001e223 < z

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 53.4% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+214}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.79999999999999993e124 or 1.15e214 < y

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.79999999999999993e124 < y < 1.15e214

    1. Initial program 86.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+124}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+214}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 51.2% 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 82.3%

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

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

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

  :alt
  (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))))