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

Percentage Accurate: 85.6% → 98.3%
Time: 12.3s
Alternatives: 19
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 19 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 85.6% accurate, 1.0× speedup?

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

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

Alternative 1: 98.3% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 96.6% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 47.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))) < 9.9999999999999994e304

    1. Initial program 99.9%

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

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

Alternative 3: 79.1% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 80.9%

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

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

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

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

    if -1.95e26 < z < 5.79999999999999982e-9

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

    if 5.79999999999999982e-9 < z < 3.4000000000000001e35 or 1.0999999999999999e140 < z < 2.70000000000000015e152

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

    if 3.4000000000000001e35 < z < 1.0999999999999999e140

    1. Initial program 99.9%

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

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

    if 2.70000000000000015e152 < z

    1. Initial program 67.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+26}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-9}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+35}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+140}:\\ \;\;\;\;x - \frac{y \cdot \left(t - z\right)}{z}\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+152}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 80.3% accurate, 0.4× speedup?

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

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

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

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

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

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


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

    1. Initial program 80.9%

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

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

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

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

    if -6.4e22 < z < 1.04e-8

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

    if 1.04e-8 < z < 5.20000000000000013e35

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000013e35 < z < 9.2000000000000002e79

    1. Initial program 100.0%

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

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

    if 9.2000000000000002e79 < z

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.4 \cdot 10^{+22}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 1.04 \cdot 10^{-8}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+35}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 9.2 \cdot 10^{+79}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5400:\\
\;\;\;\;y + x\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5400 or 4.5000000000000002e101 < z

    1. Initial program 77.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.9%

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

    if -5400 < z < 1.14e-8

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

    if 1.14e-8 < z < 5.40000000000000005e35

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if 5.40000000000000005e35 < z < 4.5000000000000002e101

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot \frac{y}{z}} \]
    9. Simplified92.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5400:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.14 \cdot 10^{-8}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{+35}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+101}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 82.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3600:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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

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


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

    1. Initial program 82.2%

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

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

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

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

    if -3600 < z < 1.24000000000000002e-8

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

    if 1.24000000000000002e-8 < z < 3.4000000000000001e35

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

    if 3.4000000000000001e35 < z

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 60.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.95 \cdot 10^{+72} \lor \neg \left(y \leq 1.56 \cdot 10^{+162}\right) \land y \leq 1.3 \cdot 10^{+259}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.9500000000000001e72 or 1.5600000000000001e162 < y < 1.30000000000000001e259

    1. Initial program 89.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified67.6%

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

    if 2.9500000000000001e72 < y < 1.5600000000000001e162 or 1.30000000000000001e259 < y

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    10. Taylor expanded in t around inf 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 63.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-77}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.15000000000000002e46 or 3e-37 < z

    1. Initial program 82.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified79.1%

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

    if -2.15000000000000002e46 < z < 4.7999999999999998e-77

    1. Initial program 95.6%

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

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

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

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

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

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

    if 4.7999999999999998e-77 < z < 3e-37

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{-a}} \]
    14. Taylor expanded in z around 0 85.9%

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

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

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

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

Alternative 9: 63.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-77}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.4499999999999999e47 or 2.20000000000000002e-37 < z

    1. Initial program 82.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified79.1%

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

    if -1.4499999999999999e47 < z < 4.99999999999999963e-77

    1. Initial program 95.6%

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

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

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

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

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

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

    if 4.99999999999999963e-77 < z < 2.20000000000000002e-37

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{-a}} \]
    14. Taylor expanded in z around 0 85.9%

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

Alternative 10: 81.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.75000000000000002e23 or 1.65e18 < z

    1. Initial program 81.0%

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

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

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

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

    if -2.75000000000000002e23 < z < 1.65e18

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

Alternative 11: 76.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3800 or 1.38e101 < z

    1. Initial program 77.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.9%

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

    if -3800 < z < 1.38e101

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

Alternative 12: 76.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -700 or 1.8999999999999999e101 < z

    1. Initial program 77.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.9%

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

    if -700 < z < 1.8999999999999999e101

    1. Initial program 95.1%

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

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

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

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

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

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

Alternative 13: 59.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.50000000000000028e86 or 4.70000000000000009e80 < y

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      10. distribute-lft-out--52.7%

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

        \[\leadsto \color{blue}{\frac{y \cdot t}{a}} - y \cdot \frac{z}{a} \]
      12. *-commutative43.4%

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

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{\frac{y}{a} \cdot z} \]
      16. *-commutative50.5%

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      17. distribute-rgt-out--54.3%

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

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

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

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

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

    if -9.50000000000000028e86 < y < 4.70000000000000009e80

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

Alternative 14: 59.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq 7.5 \cdot 10^{+80}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.3999999999999998e95

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      10. distribute-lft-out--47.3%

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

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

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

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{\frac{y}{a} \cdot z} \]
      16. *-commutative47.2%

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      17. distribute-rgt-out--50.4%

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

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

    if -4.3999999999999998e95 < y < 7.49999999999999994e80

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

    if 7.49999999999999994e80 < y

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(\frac{t}{a} - \frac{z}{a}\right)} \]
      10. distribute-lft-out--55.1%

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

        \[\leadsto \color{blue}{\frac{y \cdot t}{a}} - y \cdot \frac{z}{a} \]
      12. *-commutative43.4%

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

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

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

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

        \[\leadsto t \cdot \frac{y}{a} - \color{blue}{z \cdot \frac{y}{a}} \]
      17. distribute-rgt-out--55.9%

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

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

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

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

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

Alternative 15: 60.7% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.1e72

    1. Initial program 94.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified70.0%

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

    if 1.1e72 < y < 7.6000000000000005e161

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    10. Taylor expanded in t around inf 60.2%

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

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

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

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

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

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

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

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

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

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

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

    if 7.6000000000000005e161 < y

    1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{z - a}} \]
    12. Simplified48.1%

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

Alternative 16: 63.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+24} \lor \neg \left(z \leq 4.5 \cdot 10^{-138}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.7e24 or 4.50000000000000008e-138 < z

    1. Initial program 83.6%

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

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

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

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

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

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

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

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

    if -2.7e24 < z < 4.50000000000000008e-138

    1. Initial program 95.5%

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

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

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

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

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

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

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

Alternative 17: 98.4% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x + \frac{-1}{\frac{\frac{z - a}{t - z}}{y}} \]
  8. Add Preprocessing

Alternative 18: 53.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-136}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.02 \cdot 10^{-168}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.5000000000000003e-136 or 1.01999999999999999e-168 < x

    1. Initial program 90.0%

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

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

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

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

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

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

    if -7.5000000000000003e-136 < x < 1.01999999999999999e-168

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 51.3% accurate, 11.0× speedup?

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

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

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

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

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

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

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

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

Developer target: 98.5% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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