Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3

Percentage Accurate: 68.1% → 90.5%
Time: 16.7s
Alternatives: 25
Speedup: 0.6×

Specification

?
\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

\[\begin{array}{l} \\ x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{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(Float64(y - z) * 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[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 90.5% accurate, 0.1× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\\

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


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

    1. Initial program 68.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e-281 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0

    1. Initial program 4.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 100.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+100.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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))

    1. Initial program 75.0%

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

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

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

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

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

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

Alternative 2: 88.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ t_2 := x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-281}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+307}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z)))))
        (t_2 (+ x (/ (* (- y z) (- t x)) (- a z)))))
   (if (<= t_2 -1e-281)
     t_1
     (if (<= t_2 0.0)
       (- t (/ (* (- t x) (- y a)) z))
       (if (<= t_2 2e+307) t_2 t_1)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double t_2 = x + (((y - z) * (t - x)) / (a - z));
	double tmp;
	if (t_2 <= -1e-281) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t - (((t - x) * (y - a)) / z);
	} else if (t_2 <= 2e+307) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    t_2 = x + (((y - z) * (t - x)) / (a - z))
    if (t_2 <= (-1d-281)) then
        tmp = t_1
    else if (t_2 <= 0.0d0) then
        tmp = t - (((t - x) * (y - a)) / z)
    else if (t_2 <= 2d+307) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double t_2 = x + (((y - z) * (t - x)) / (a - z));
	double tmp;
	if (t_2 <= -1e-281) {
		tmp = t_1;
	} else if (t_2 <= 0.0) {
		tmp = t - (((t - x) * (y - a)) / z);
	} else if (t_2 <= 2e+307) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	t_2 = x + (((y - z) * (t - x)) / (a - z))
	tmp = 0
	if t_2 <= -1e-281:
		tmp = t_1
	elif t_2 <= 0.0:
		tmp = t - (((t - x) * (y - a)) / z)
	elif t_2 <= 2e+307:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	t_2 = Float64(x + Float64(Float64(Float64(y - z) * Float64(t - x)) / Float64(a - z)))
	tmp = 0.0
	if (t_2 <= -1e-281)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = Float64(t - Float64(Float64(Float64(t - x) * Float64(y - a)) / z));
	elseif (t_2 <= 2e+307)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((y - z) * ((t - x) / (a - z)));
	t_2 = x + (((y - z) * (t - x)) / (a - z));
	tmp = 0.0;
	if (t_2 <= -1e-281)
		tmp = t_1;
	elseif (t_2 <= 0.0)
		tmp = t - (((t - x) * (y - a)) / z);
	elseif (t_2 <= 2e+307)
		tmp = t_2;
	else
		tmp = t_1;
	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]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-281], t$95$1, If[LessEqual[t$95$2, 0.0], N[(t - N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+307], t$95$2, t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < -1e-281 or 1.99999999999999997e307 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z)))

    1. Initial program 61.6%

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

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

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

    if -1e-281 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0

    1. Initial program 4.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 100.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+100.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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 1.99999999999999997e307

    1. Initial program 94.5%

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

Alternative 3: 90.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a - z}{y - z}}} \]
    7. Simplified91.8%

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

    if -1e-281 < (+.f64 x (/.f64 (*.f64 (-.f64 y z) (-.f64 t x)) (-.f64 a z))) < 0.0

    1. Initial program 4.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 100.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+100.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. associate-*r/100.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 48.6% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -8.00000000000000006e155

    1. Initial program 74.6%

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

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

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

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

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

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

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

    if -8.00000000000000006e155 < a < -4.4e-41

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

    if -4.4e-41 < a < 0.0850000000000000061

    1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

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

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

    if 0.0850000000000000061 < a < 9.50000000000000032e181

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000032e181 < a

    1. Initial program 62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - z \cdot \frac{t - x}{a}} \]
    11. Taylor expanded in x around inf 73.2%

      \[\leadsto \color{blue}{x \cdot \left(1 - -1 \cdot \frac{z}{a}\right)} \]
    12. Step-by-step derivation
      1. sub-neg73.2%

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

        \[\leadsto x \cdot \left(1 + \left(-\color{blue}{\left(-\frac{z}{a}\right)}\right)\right) \]
      3. remove-double-neg73.2%

        \[\leadsto x \cdot \left(1 + \color{blue}{\frac{z}{a}}\right) \]
    13. Simplified73.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{+155}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -4.4 \cdot 10^{-41}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;a \leq 0.085:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+181}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 48.6% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.4000000000000003e153 or 8.20000000000000029e183 < a

    1. Initial program 70.0%

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

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

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

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

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

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

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

    if -6.4000000000000003e153 < a < -4.34999999999999992e-41

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

    if -4.34999999999999992e-41 < a < 1.65000000000000008e-6

    1. Initial program 61.7%

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

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

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

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

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

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

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

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

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

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

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

    if 1.65000000000000008e-6 < a < 8.20000000000000029e183

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 72.5% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 29.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified95.7%

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

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

        \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
    13. Simplified95.7%

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

    if -1.50000000000000003e254 < z < -9.5000000000000006e74

    1. Initial program 50.7%

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

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

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

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

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

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

      \[\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+69.6%

        \[\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. associate-*r/69.6%

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

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

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

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

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

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

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

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

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

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

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

    if -9.5000000000000006e74 < z < 2.60000000000000015e79

    1. Initial program 86.9%

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

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

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

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

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

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

    if 2.60000000000000015e79 < z

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 63.5% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

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

    if -3.50000000000000014e74 < z < 9.4999999999999996e-115

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.4999999999999996e-115 < z < 1.15000000000000008e69

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

    if 1.15000000000000008e69 < z

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified78.8%

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

Alternative 8: 62.7% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

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

    if -7.99999999999999961e74 < z < 4.10000000000000007e-132

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

    if 4.10000000000000007e-132 < z < 3.5e67

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

    if 3.5e67 < z

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified78.8%

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

Alternative 9: 62.7% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

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

    if -2.11999999999999998e74 < z < 2.6000000000000001e-132

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

    if 2.6000000000000001e-132 < z < 4.5000000000000003e68

    1. Initial program 82.0%

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

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

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

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

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

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

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

    if 4.5000000000000003e68 < z

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified78.8%

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

Alternative 10: 62.6% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

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

    if -2.25e74 < z < 4.2000000000000002e-132

    1. Initial program 88.9%

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

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

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

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

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

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

    if 4.2000000000000002e-132 < z < 1.27999999999999998e69

    1. Initial program 82.0%

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

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

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

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

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

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

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

    if 1.27999999999999998e69 < z

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified78.8%

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

Alternative 11: 55.3% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

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

    if -1.8999999999999999e74 < z < -2.45000000000000013e-288

    1. Initial program 88.4%

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

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

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

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

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

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

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

    if -2.45000000000000013e-288 < z < 8e80

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

    if 8e80 < z

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
    13. Simplified79.1%

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

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

Alternative 12: 81.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+253} \lor \neg \left(z \leq 8.2 \cdot 10^{+107}\right):\\
\;\;\;\;t - a \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.59999999999999978e253 or 8.1999999999999998e107 < z

    1. Initial program 26.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.59999999999999978e253 < z < 8.1999999999999998e107

    1. Initial program 78.9%

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

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

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

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

Alternative 13: 49.2% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.00000000000000001e155 or 1.15000000000000008e96 < a

    1. Initial program 71.7%

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

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

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

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

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

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

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

    if -1.00000000000000001e155 < a < -4.34999999999999992e-41

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

    if -4.34999999999999992e-41 < a < 1.15000000000000008e96

    1. Initial program 62.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 38.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{-63}:\\
\;\;\;\;x + t\\

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

\mathbf{elif}\;z \leq 7 \cdot 10^{+65}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.00000000000000025e95 or 7.0000000000000002e65 < z

    1. Initial program 39.1%

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

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

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

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

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

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

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

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

    if -5.00000000000000025e95 < z < -1.25e-63

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

    if -1.25e-63 < z < -5.00000000000000029e-289

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified45.7%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    10. Applied egg-rr45.8%

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

    if -5.00000000000000029e-289 < z < 7.0000000000000002e65

    1. Initial program 85.2%

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

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

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

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

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

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

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

Alternative 15: 38.5% accurate, 0.6× speedup?

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

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

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

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

\mathbf{elif}\;z \leq 9.5 \cdot 10^{+65}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.7999999999999999e95 or 9.5000000000000005e65 < z

    1. Initial program 39.1%

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

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

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

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

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

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

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

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

    if -3.7999999999999999e95 < z < -1e-58

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

    if -1e-58 < z < -5.3000000000000004e-288

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified45.7%

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

    if -5.3000000000000004e-288 < z < 9.5000000000000005e65

    1. Initial program 85.2%

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

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

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

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

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

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

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

Alternative 16: 70.1% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 37.3%

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

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

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

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

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

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

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

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

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

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

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

    if -2.4000000000000002e183 < z < 1.19999999999999995e81

    1. Initial program 80.5%

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

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

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

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

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

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

    if 1.19999999999999995e81 < z

    1. Initial program 29.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 59.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

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

    if -1.4500000000000001e74 < z < 1.27999999999999998e69

    1. Initial program 86.7%

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

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

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

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

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

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

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

    if 1.27999999999999998e69 < z

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified78.8%

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

Alternative 18: 55.4% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 46.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

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

    if -1.3e74 < z < 1.3999999999999999e67

    1. Initial program 86.7%

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

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

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

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

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

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

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

    if 1.3999999999999999e67 < z

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified78.8%

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

Alternative 19: 55.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+74} \lor \neg \left(z \leq 2.75 \cdot 10^{+54}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.25e74 or 2.75000000000000013e54 < z

    1. Initial program 40.7%

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

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

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

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

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

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

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

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

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

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

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

    if -2.25e74 < z < 2.75000000000000013e54

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

Alternative 20: 51.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{-32} \lor \neg \left(a \leq 0.00026\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.10000000000000011e-32 or 2.59999999999999977e-4 < a

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

    if -3.10000000000000011e-32 < a < 2.59999999999999977e-4

    1. Initial program 62.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)} \]
    6. Taylor expanded in a around 0 63.4%

      \[\leadsto \color{blue}{t \cdot \left(1 + -1 \cdot \frac{y}{z}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg63.4%

        \[\leadsto t \cdot \left(1 + \color{blue}{\left(-\frac{y}{z}\right)}\right) \]
      2. unsub-neg63.4%

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified63.4%

      \[\leadsto \color{blue}{t \cdot \left(1 - \frac{y}{z}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.1 \cdot 10^{-32} \lor \neg \left(a \leq 0.00026\right):\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 55.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+74}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+66}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.3e+74)
   (* t (- 1.0 (/ y z)))
   (if (<= z 3.8e+66) (+ x (* y (/ t a))) (- t (* a (/ x z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.3e+74) {
		tmp = t * (1.0 - (y / z));
	} else if (z <= 3.8e+66) {
		tmp = x + (y * (t / a));
	} else {
		tmp = t - (a * (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 (z <= (-1.3d+74)) then
        tmp = t * (1.0d0 - (y / z))
    else if (z <= 3.8d+66) then
        tmp = x + (y * (t / a))
    else
        tmp = t - (a * (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 (z <= -1.3e+74) {
		tmp = t * (1.0 - (y / z));
	} else if (z <= 3.8e+66) {
		tmp = x + (y * (t / a));
	} else {
		tmp = t - (a * (x / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.3e+74:
		tmp = t * (1.0 - (y / z))
	elif z <= 3.8e+66:
		tmp = x + (y * (t / a))
	else:
		tmp = t - (a * (x / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.3e+74)
		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
	elseif (z <= 3.8e+66)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	else
		tmp = Float64(t - Float64(a * Float64(x / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.3e+74)
		tmp = t * (1.0 - (y / z));
	elseif (z <= 3.8e+66)
		tmp = x + (y * (t / a));
	else
		tmp = t - (a * (x / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+74], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+66], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(a * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+74}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{+66}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{else}:\\
\;\;\;\;t - a \cdot \frac{x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3e74

    1. Initial program 46.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative46.0%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative46.0%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*79.0%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define79.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified79.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 63.6%

      \[\leadsto \color{blue}{t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)} \]
    6. Taylor expanded in a around 0 60.0%

      \[\leadsto \color{blue}{t \cdot \left(1 + -1 \cdot \frac{y}{z}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg60.0%

        \[\leadsto t \cdot \left(1 + \color{blue}{\left(-\frac{y}{z}\right)}\right) \]
      2. unsub-neg60.0%

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

      \[\leadsto \color{blue}{t \cdot \left(1 - \frac{y}{z}\right)} \]

    if -1.3e74 < z < 3.8000000000000002e66

    1. Initial program 86.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*94.5%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 62.0%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(t - x\right)}{a}} \]
    6. Step-by-step derivation
      1. associate-/l*69.3%

        \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]
    7. Simplified69.3%

      \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]
    8. Taylor expanded in t around inf 57.2%

      \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]

    if 3.8000000000000002e66 < z

    1. Initial program 32.2%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative32.2%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative32.2%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*61.6%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define61.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified61.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 26.1%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg26.1%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*44.4%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out44.4%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative44.4%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative44.4%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define44.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified44.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 70.0%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*78.8%

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified78.8%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    11. Taylor expanded in t around 0 76.9%

      \[\leadsto t + a \cdot \frac{\color{blue}{-1 \cdot x}}{z} \]
    12. Step-by-step derivation
      1. neg-mul-176.9%

        \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
    13. Simplified76.9%

      \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+74}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+66}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 54.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+74}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+66}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.3e+74)
   (* t (- 1.0 (/ y z)))
   (if (<= z 1.1e+66) (+ x (* y (/ t a))) (* t (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.3e+74) {
		tmp = t * (1.0 - (y / z));
	} else if (z <= 1.1e+66) {
		tmp = x + (y * (t / a));
	} else {
		tmp = t * (z / (z - a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-1.3d+74)) then
        tmp = t * (1.0d0 - (y / z))
    else if (z <= 1.1d+66) then
        tmp = x + (y * (t / a))
    else
        tmp = t * (z / (z - a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.3e+74) {
		tmp = t * (1.0 - (y / z));
	} else if (z <= 1.1e+66) {
		tmp = x + (y * (t / a));
	} else {
		tmp = t * (z / (z - a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.3e+74:
		tmp = t * (1.0 - (y / z))
	elif z <= 1.1e+66:
		tmp = x + (y * (t / a))
	else:
		tmp = t * (z / (z - a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.3e+74)
		tmp = Float64(t * Float64(1.0 - Float64(y / z)));
	elseif (z <= 1.1e+66)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	else
		tmp = Float64(t * Float64(z / Float64(z - a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.3e+74)
		tmp = t * (1.0 - (y / z));
	elseif (z <= 1.1e+66)
		tmp = x + (y * (t / a));
	else
		tmp = t * (z / (z - a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e+74], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+66], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+74}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

\mathbf{elif}\;z \leq 1.1 \cdot 10^{+66}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{else}:\\
\;\;\;\;t \cdot \frac{z}{z - a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3e74

    1. Initial program 46.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative46.0%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative46.0%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*79.0%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define79.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified79.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 63.6%

      \[\leadsto \color{blue}{t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)} \]
    6. Taylor expanded in a around 0 60.0%

      \[\leadsto \color{blue}{t \cdot \left(1 + -1 \cdot \frac{y}{z}\right)} \]
    7. Step-by-step derivation
      1. mul-1-neg60.0%

        \[\leadsto t \cdot \left(1 + \color{blue}{\left(-\frac{y}{z}\right)}\right) \]
      2. unsub-neg60.0%

        \[\leadsto t \cdot \color{blue}{\left(1 - \frac{y}{z}\right)} \]
    8. Simplified60.0%

      \[\leadsto \color{blue}{t \cdot \left(1 - \frac{y}{z}\right)} \]

    if -1.3e74 < z < 1.0999999999999999e66

    1. Initial program 86.6%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*94.5%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 61.7%

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(t - x\right)}{a}} \]
    6. Step-by-step derivation
      1. associate-/l*69.1%

        \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]
    7. Simplified69.1%

      \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]
    8. Taylor expanded in t around inf 57.6%

      \[\leadsto x + y \cdot \color{blue}{\frac{t}{a}} \]

    if 1.0999999999999999e66 < z

    1. Initial program 33.4%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative33.4%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative33.4%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*62.3%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define62.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified62.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 69.5%

      \[\leadsto \color{blue}{t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)} \]
    6. Taylor expanded in y around 0 65.9%

      \[\leadsto t \cdot \color{blue}{\left(-1 \cdot \frac{z}{a - z}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/65.9%

        \[\leadsto t \cdot \color{blue}{\frac{-1 \cdot z}{a - z}} \]
      2. mul-1-neg65.9%

        \[\leadsto t \cdot \frac{\color{blue}{-z}}{a - z} \]
    8. Simplified65.9%

      \[\leadsto t \cdot \color{blue}{\frac{-z}{a - z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+74}:\\ \;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+66}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 68.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 3.8 \cdot 10^{+107}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z 3.8e+107) (+ x (* t (/ (- y z) (- a z)))) (- t (* a (/ x z)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 3.8e+107) {
		tmp = x + (t * ((y - z) / (a - z)));
	} else {
		tmp = t - (a * (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 (z <= 3.8d+107) then
        tmp = x + (t * ((y - z) / (a - z)))
    else
        tmp = t - (a * (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 (z <= 3.8e+107) {
		tmp = x + (t * ((y - z) / (a - z)));
	} else {
		tmp = t - (a * (x / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= 3.8e+107:
		tmp = x + (t * ((y - z) / (a - z)))
	else:
		tmp = t - (a * (x / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= 3.8e+107)
		tmp = Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z))));
	else
		tmp = Float64(t - Float64(a * Float64(x / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= 3.8e+107)
		tmp = x + (t * ((y - z) / (a - z)));
	else
		tmp = t - (a * (x / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 3.8e+107], N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(a * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.8 \cdot 10^{+107}:\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\

\mathbf{else}:\\
\;\;\;\;t - a \cdot \frac{x}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.7999999999999998e107

    1. Initial program 76.0%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. associate-/l*88.2%

        \[\leadsto x + \color{blue}{\left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    3. Simplified88.2%

      \[\leadsto \color{blue}{x + \left(y - z\right) \cdot \frac{t - x}{a - z}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 63.6%

      \[\leadsto x + \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
    6. Step-by-step derivation
      1. associate-/l*72.5%

        \[\leadsto x + \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    7. Simplified72.5%

      \[\leadsto x + \color{blue}{t \cdot \frac{y - z}{a - z}} \]

    if 3.7999999999999998e107 < z

    1. Initial program 25.8%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative25.8%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative25.8%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*58.9%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define58.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified58.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 23.0%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{z \cdot \left(t - x\right)}{a - z}} \]
    6. Step-by-step derivation
      1. mul-1-neg23.0%

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. associate-/l*43.6%

        \[\leadsto x + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right) \]
      3. distribute-lft-neg-out43.6%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z}} \]
      4. +-commutative43.6%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{t - x}{a - z} + x} \]
      5. *-commutative43.6%

        \[\leadsto \color{blue}{\frac{t - x}{a - z} \cdot \left(-z\right)} + x \]
      6. fma-define43.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    7. Simplified43.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{t - x}{a - z}, -z, x\right)} \]
    8. Taylor expanded in z around inf 73.0%

      \[\leadsto \color{blue}{t + \frac{a \cdot \left(t - x\right)}{z}} \]
    9. Step-by-step derivation
      1. associate-/l*82.9%

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    10. Simplified82.9%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    11. Taylor expanded in t around 0 83.3%

      \[\leadsto t + a \cdot \frac{\color{blue}{-1 \cdot x}}{z} \]
    12. Step-by-step derivation
      1. neg-mul-183.3%

        \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
    13. Simplified83.3%

      \[\leadsto t + a \cdot \frac{\color{blue}{-x}}{z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 3.8 \cdot 10^{+107}:\\ \;\;\;\;x + t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 38.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+74}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+65}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.6e+74) t (if (<= z 6.2e+65) x t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.6e+74) {
		tmp = t;
	} else if (z <= 6.2e+65) {
		tmp = x;
	} else {
		tmp = 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.6d+74)) then
        tmp = t
    else if (z <= 6.2d+65) then
        tmp = x
    else
        tmp = 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.6e+74) {
		tmp = t;
	} else if (z <= 6.2e+65) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.6e+74:
		tmp = t
	elif z <= 6.2e+65:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.6e+74)
		tmp = t;
	elseif (z <= 6.2e+65)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.6e+74)
		tmp = t;
	elseif (z <= 6.2e+65)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e+74], t, If[LessEqual[z, 6.2e+65], x, t]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+74}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 6.2 \cdot 10^{+65}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.59999999999999997e74 or 6.19999999999999981e65 < z

    1. Initial program 39.7%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative39.7%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative39.7%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*70.6%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define70.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified70.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 66.6%

      \[\leadsto \color{blue}{t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)} \]
    6. Taylor expanded in z around inf 54.8%

      \[\leadsto \color{blue}{t} \]

    if -1.59999999999999997e74 < z < 6.19999999999999981e65

    1. Initial program 86.6%

      \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative86.6%

        \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
      2. *-commutative86.6%

        \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
      3. associate-/l*95.9%

        \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
      4. fma-define95.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    3. Simplified95.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 33.6%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 25: 24.7% 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 66.6%

    \[x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} \]
  2. Step-by-step derivation
    1. +-commutative66.6%

      \[\leadsto \color{blue}{\frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z} + x} \]
    2. *-commutative66.6%

      \[\leadsto \frac{\color{blue}{\left(t - x\right) \cdot \left(y - z\right)}}{a - z} + x \]
    3. associate-/l*85.1%

      \[\leadsto \color{blue}{\left(t - x\right) \cdot \frac{y - z}{a - z}} + x \]
    4. fma-define85.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
  3. Simplified85.1%

    \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in t around inf 56.3%

    \[\leadsto \color{blue}{t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)} \]
  6. Taylor expanded in z around inf 27.2%

    \[\leadsto \color{blue}{t} \]
  7. Add Preprocessing

Developer Target 1: 83.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\ \mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* (/ y z) (- t x)))))
   (if (< z -1.2536131056095036e+188)
     t_1
     (if (< z 4.446702369113811e+64)
       (+ x (/ (- y z) (/ (- a z) (- t x))))
       t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - ((y / z) * (t - x));
	double tmp;
	if (z < -1.2536131056095036e+188) {
		tmp = t_1;
	} else if (z < 4.446702369113811e+64) {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	} 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 = t - ((y / z) * (t - x))
    if (z < (-1.2536131056095036d+188)) then
        tmp = t_1
    else if (z < 4.446702369113811d+64) then
        tmp = x + ((y - z) / ((a - z) / (t - x)))
    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 = t - ((y / z) * (t - x));
	double tmp;
	if (z < -1.2536131056095036e+188) {
		tmp = t_1;
	} else if (z < 4.446702369113811e+64) {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - ((y / z) * (t - x))
	tmp = 0
	if z < -1.2536131056095036e+188:
		tmp = t_1
	elif z < 4.446702369113811e+64:
		tmp = x + ((y - z) / ((a - z) / (t - x)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(Float64(y / z) * Float64(t - x)))
	tmp = 0.0
	if (z < -1.2536131056095036e+188)
		tmp = t_1;
	elseif (z < 4.446702369113811e+64)
		tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - ((y / z) * (t - x));
	tmp = 0.0;
	if (z < -1.2536131056095036e+188)
		tmp = t_1;
	elseif (z < 4.446702369113811e+64)
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(N[(y / z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -1.2536131056095036e+188], t$95$1, If[Less[z, 4.446702369113811e+64], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t - \frac{y}{z} \cdot \left(t - x\right)\\
\mathbf{if}\;z < -1.2536131056095036 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z < 4.446702369113811 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024121 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< z -125361310560950360000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- t (* (/ y z) (- t x))) (if (< z 44467023691138110000000000000000000000000000000000000000000000000) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x))))))

  (+ x (/ (* (- y z) (- t x)) (- a z))))