Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.6% → 91.2%
Time: 13.5s
Alternatives: 22
Speedup: 0.3×

Specification

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

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

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

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

Alternative 1: 91.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t\_1\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-271} \lor \neg \left(t\_2 \leq 2 \cdot 10^{-292}\right):\\ \;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
   (if (or (<= t_2 -2e-271) (not (<= t_2 2e-292)))
     (fma (- y z) t_1 x)
     (+ t (* (/ (- t x) z) (- a y))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) / (a - z);
	double t_2 = x + ((y - z) * t_1);
	double tmp;
	if ((t_2 <= -2e-271) || !(t_2 <= 2e-292)) {
		tmp = fma((y - z), t_1, x);
	} else {
		tmp = t + (((t - x) / z) * (a - y));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) / Float64(a - z))
	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
	tmp = 0.0
	if ((t_2 <= -2e-271) || !(t_2 <= 2e-292))
		tmp = fma(Float64(y - z), t_1, x);
	else
		tmp = Float64(t + Float64(Float64(Float64(t - x) / z) * Float64(a - y)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e-271], N[Not[LessEqual[t$95$2, 2e-292]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t$95$1 + x), $MachinePrecision], N[(t + N[(N[(N[(t - x), $MachinePrecision] / z), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t\_1\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-271} \lor \neg \left(t\_2 \leq 2 \cdot 10^{-292}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, t\_1, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.99999999999999993e-271 or 2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.2%

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

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

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

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

    if -1.99999999999999993e-271 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2.0000000000000001e-292

    1. Initial program 3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 91.2% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.99999999999999993e-271 or 2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.2%

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

    if -1.99999999999999993e-271 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 2.0000000000000001e-292

    1. Initial program 3.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 42.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{a}\right)\\
\mathbf{if}\;a \leq -2.1 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.65 \cdot 10^{-280}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-93}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.10000000000000013e-21 or 4.5999999999999997e75 < a

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000013e-21 < a < 1.64999999999999995e-280

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    10. Simplified46.7%

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

    if 1.64999999999999995e-280 < a < 5.49999999999999968e-93

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

    if 5.49999999999999968e-93 < a < 4.5999999999999997e75

    1. Initial program 80.8%

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

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

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

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

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

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

Alternative 4: 37.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.85 \cdot 10^{+228}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -8.6 \cdot 10^{-119}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;a \leq 0.000125:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{+71}:\\
\;\;\;\;y \cdot \frac{t}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.8500000000000001e228 or 2.49999999999999986e71 < a

    1. Initial program 98.4%

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

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

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

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

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

    if -2.8500000000000001e228 < a < -8.5999999999999999e-119

    1. Initial program 80.6%

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

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

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

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

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

    if -8.5999999999999999e-119 < a < 1.25e-4

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e-4 < a < 2.49999999999999986e71

    1. Initial program 77.0%

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

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

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

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

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

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

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

Alternative 5: 38.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+228}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;a \leq 7.2 \cdot 10^{-280}:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;a \leq 7 \cdot 10^{+77}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.2000000000000003e228 or 7.0000000000000003e77 < a

    1. Initial program 98.3%

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

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

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

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

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

    if -3.2000000000000003e228 < a < -7.50000000000000044e-119

    1. Initial program 80.6%

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

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

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

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

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

    if -7.50000000000000044e-119 < a < 7.19999999999999989e-280

    1. Initial program 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999989e-280 < a < 7.0000000000000003e77

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

Alternative 6: 74.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.4999999999999994e-67 or 2.7500000000000001e-5 < a

    1. Initial program 88.6%

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

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

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

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

    if -9.4999999999999994e-67 < a < 2.7500000000000001e-5

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 85.7%

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

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

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

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

    if -7.0000000000000001e-67 < a < 2.79999999999999996e-5

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999996e-5 < a

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

Alternative 8: 74.2% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 85.7%

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

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

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

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

    if -5.29999999999999971e-67 < a < 2.8500000000000002e-5

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8500000000000002e-5 < a

    1. Initial program 91.7%

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

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

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

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

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

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

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

Alternative 9: 67.5% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.70000000000000014e-33 or 1.15e48 < a

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

    if -3.70000000000000014e-33 < a < 1.15e48

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 59.8% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.1e-42 or 1.74999999999999987e49 < a

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

    if -5.1e-42 < a < 1.74999999999999987e49

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 59.2% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2e30 or 1.11999999999999995e48 < a

    1. Initial program 90.1%

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

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

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

    if -1.2e30 < a < 1.11999999999999995e48

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 60.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.75 \cdot 10^{-36} \lor \neg \left(a \leq 1.02 \cdot 10^{+48}\right):\\
\;\;\;\;x + y \cdot \frac{t - x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.74999999999999992e-36 or 1.02e48 < a

    1. Initial program 89.2%

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

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

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

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

    if -2.74999999999999992e-36 < a < 1.02e48

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 56.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-42}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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

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


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

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

    if -4.5e-42 < a < 1.0499999999999999e48

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0499999999999999e48 < a

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

Alternative 14: 46.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{-67} \lor \neg \left(a \leq 2.75 \cdot 10^{-5}\right):\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.99999999999999954e-67 or 2.7500000000000001e-5 < a

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

    if -7.99999999999999954e-67 < a < 2.7500000000000001e-5

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    10. Simplified42.7%

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

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

Alternative 15: 42.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.6 \cdot 10^{-18} \lor \neg \left(a \leq 4.7 \cdot 10^{+70}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.6000000000000002e-18 or 4.6999999999999998e70 < a

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.6000000000000002e-18 < a < 4.6999999999999998e70

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    10. Simplified39.7%

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

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

Alternative 16: 49.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{-35}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

\mathbf{elif}\;a \leq 0.000108:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\

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


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

    1. Initial program 87.1%

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

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

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

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

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

    if -6.8000000000000005e-35 < a < 1.08e-4

    1. Initial program 67.8%

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t}{z} - -1 \cdot \frac{x}{z}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out--47.5%

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

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

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

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

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

    if 1.08e-4 < a

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

Alternative 17: 47.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-116}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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

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


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

    1. Initial program 84.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Simplified52.4%

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

    if -2.7999999999999999e-116 < a < 8.39999999999999964e-60

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\frac{-1 \cdot y}{a - z}} \]
      2. mul-1-neg47.4%

        \[\leadsto x \cdot \frac{\color{blue}{-y}}{a - z} \]
    10. Simplified47.4%

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

    if 8.39999999999999964e-60 < a

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

Alternative 18: 46.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4 \cdot 10^{-67}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

\mathbf{elif}\;a \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\

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


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

    1. Initial program 85.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    8. Simplified55.9%

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

    if -3.99999999999999977e-67 < a < 3.4999999999999997e-5

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    10. Simplified42.7%

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

    if 3.4999999999999997e-5 < a

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

Alternative 19: 45.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{-67}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\

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

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


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

    1. Initial program 85.7%

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

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

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

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

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

    if -4.0999999999999997e-67 < a < 2.7500000000000001e-5

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    10. Simplified42.7%

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

    if 2.7500000000000001e-5 < a

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

Alternative 20: 46.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+47}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{-92}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\

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


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

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

    if -1.1499999999999999e47 < z < 5.2e-92

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2e-92 < z

    1. Initial program 74.3%

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

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

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

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

      \[\leadsto x + \color{blue}{t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 21: 38.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{+30}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.6 \cdot 10^{+79}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.4499999999999999e30 or 3.5999999999999999e79 < a

    1. Initial program 92.8%

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

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

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

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

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

    if -1.4499999999999999e30 < a < 3.5999999999999999e79

    1. Initial program 70.2%

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

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

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

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

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

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

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

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

Alternative 22: 24.5% accurate, 13.0× speedup?

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

\\
t
\end{array}
Derivation
  1. Initial program 79.0%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{t} \]
  8. Add Preprocessing

Reproduce

?
herbie shell --seed 2024165 
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  :precision binary64
  (+ x (* (- y z) (/ (- t x) (- a z)))))