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

Percentage Accurate: 98.0% → 98.0%
Time: 15.0s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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: 98.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 87.0% accurate, 0.2× speedup?

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

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

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

\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\

\mathbf{elif}\;t\_1 \leq 10^{+111}:\\
\;\;\;\;y \cdot t\_1\\

\mathbf{elif}\;t\_1 \leq 10^{+204}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e17

    1. Initial program 97.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in68.5%

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

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

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

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

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

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

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

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

    if -5e17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.10000000000000001

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

    if 0.10000000000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2

    1. Initial program 100.0%

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

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

    if 2 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.99999999999999957e110

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt98.3%

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)}\right)}^{3}} \]
    5. Taylor expanded in x around 0 73.4%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \frac{y \cdot \left(z - t\right)}{z - a}} \]
    6. Step-by-step derivation
      1. pow-base-173.4%

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

        \[\leadsto 1 \cdot \color{blue}{\left(y \cdot \frac{z - t}{z - a}\right)} \]
      3. *-lft-identity89.1%

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

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

    if 9.99999999999999957e110 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.99999999999999989e203

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in87.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{z}{-t}}} \]
      11. add-sqr-sqrt12.8%

        \[\leadsto x - \frac{y}{\frac{z}{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}} \]
      12. sqrt-unprod26.2%

        \[\leadsto x - \frac{y}{\frac{z}{\color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}} \]
      13. sqr-neg26.2%

        \[\leadsto x - \frac{y}{\frac{z}{\sqrt{\color{blue}{t \cdot t}}}} \]
      14. sqrt-unprod50.2%

        \[\leadsto x - \frac{y}{\frac{z}{\color{blue}{\sqrt{t} \cdot \sqrt{t}}}} \]
      15. add-sqr-sqrt87.7%

        \[\leadsto x - \frac{y}{\frac{z}{\color{blue}{t}}} \]
    8. Applied egg-rr87.7%

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

    if 9.99999999999999989e203 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 84.3%

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

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

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

        \[\leadsto x + \color{blue}{\frac{z - t}{z - a} \cdot y} \]
      3. associate-/r/99.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    10. Step-by-step derivation
      1. mul-1-neg93.3%

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

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

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

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

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

Alternative 3: 81.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0.1:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;t\_1 \leq 2:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e17

    1. Initial program 97.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in68.5%

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

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

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

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

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

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

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

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

    if -5e17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.10000000000000001

    1. Initial program 99.6%

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

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

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      2. *-commutative78.8%

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

        \[\leadsto \frac{y \cdot t}{\color{blue}{1 \cdot a}} + x \]
      4. times-frac84.2%

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{t}{a}} + x \]
      5. /-rgt-identity84.2%

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

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

    if 0.10000000000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified99.2%

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

    if 2 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 93.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt92.6%

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

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

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

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)}}\right)}^{3} \]
    4. Applied egg-rr92.6%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)}\right)}^{3}} \]
    5. Taylor expanded in x around 0 77.2%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \frac{y \cdot \left(z - t\right)}{z - a}} \]
    6. Step-by-step derivation
      1. pow-base-177.2%

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

        \[\leadsto 1 \cdot \color{blue}{\left(y \cdot \frac{z - t}{z - a}\right)} \]
      3. *-lft-identity78.0%

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

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

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

Alternative 4: 96.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z - t}{z - a}\\ t_2 := x - \frac{y \cdot t}{z - a}\\ \mathbf{if}\;t\_1 \leq -50000000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0.1:\\ \;\;\;\;x + y \cdot \frac{t - z}{a}\\ \mathbf{elif}\;t\_1 \leq 50000:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (- x (/ (* y t) (- z a)))))
   (if (<= t_1 -50000000000.0)
     t_2
     (if (<= t_1 0.1)
       (+ x (* y (/ (- t z) a)))
       (if (<= t_1 50000.0) (- x (* y (/ (- t z) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) / (z - a);
	double t_2 = x - ((y * t) / (z - a));
	double tmp;
	if (t_1 <= -50000000000.0) {
		tmp = t_2;
	} else if (t_1 <= 0.1) {
		tmp = x + (y * ((t - z) / a));
	} else if (t_1 <= 50000.0) {
		tmp = x - (y * ((t - z) / z));
	} else {
		tmp = t_2;
	}
	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 = (z - t) / (z - a)
    t_2 = x - ((y * t) / (z - a))
    if (t_1 <= (-50000000000.0d0)) then
        tmp = t_2
    else if (t_1 <= 0.1d0) then
        tmp = x + (y * ((t - z) / a))
    else if (t_1 <= 50000.0d0) then
        tmp = x - (y * ((t - z) / z))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (z - t) / (z - a);
	double t_2 = x - ((y * t) / (z - a));
	double tmp;
	if (t_1 <= -50000000000.0) {
		tmp = t_2;
	} else if (t_1 <= 0.1) {
		tmp = x + (y * ((t - z) / a));
	} else if (t_1 <= 50000.0) {
		tmp = x - (y * ((t - z) / z));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (z - t) / (z - a)
	t_2 = x - ((y * t) / (z - a))
	tmp = 0
	if t_1 <= -50000000000.0:
		tmp = t_2
	elif t_1 <= 0.1:
		tmp = x + (y * ((t - z) / a))
	elif t_1 <= 50000.0:
		tmp = x - (y * ((t - z) / z))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(z - t) / Float64(z - a))
	t_2 = Float64(x - Float64(Float64(y * t) / Float64(z - a)))
	tmp = 0.0
	if (t_1 <= -50000000000.0)
		tmp = t_2;
	elseif (t_1 <= 0.1)
		tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a)));
	elseif (t_1 <= 50000.0)
		tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (z - t) / (z - a);
	t_2 = x - ((y * t) / (z - a));
	tmp = 0.0;
	if (t_1 <= -50000000000.0)
		tmp = t_2;
	elseif (t_1 <= 0.1)
		tmp = x + (y * ((t - z) / a));
	elseif (t_1 <= 50000.0)
		tmp = x - (y * ((t - z) / z));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -50000000000.0], t$95$2, If[LessEqual[t$95$1, 0.1], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 50000.0], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x - \frac{y \cdot t}{z - a}\\
\mathbf{if}\;t\_1 \leq -50000000000:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t\_1 \leq 50000:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e10 or 5e4 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 95.2%

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

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-lft-neg-out91.1%

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

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

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

    if -5e10 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.10000000000000001

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a}} \]
      5. /-rgt-identity98.2%

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

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

    if 0.10000000000000001 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5e4

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \leq -50000000000:\\ \;\;\;\;x - \frac{y \cdot t}{z - a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 0.1:\\ \;\;\;\;x + y \cdot \frac{t - z}{a}\\ \mathbf{elif}\;\frac{z - t}{z - a} \leq 50000:\\ \;\;\;\;x - y \cdot \frac{t - z}{z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y \cdot t}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 81.8% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < -5e17

    1. Initial program 97.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in68.5%

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

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

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

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

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

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

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

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

    if -5e17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2

    1. Initial program 99.8%

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

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

    if 2 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 93.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cube-cbrt92.6%

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

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

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

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)}}\right)}^{3} \]
    4. Applied egg-rr92.6%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)}\right)}^{3}} \]
    5. Taylor expanded in x around 0 77.2%

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot \frac{y \cdot \left(z - t\right)}{z - a}} \]
    6. Step-by-step derivation
      1. pow-base-177.2%

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

        \[\leadsto 1 \cdot \color{blue}{\left(y \cdot \frac{z - t}{z - a}\right)} \]
      3. *-lft-identity78.0%

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

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

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

Alternative 6: 76.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 700000000:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{+142} \lor \neg \left(z \leq 1.2 \cdot 10^{+181}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.5000000000000006e-40 or 7e8 < z < 4.7e142 or 1.20000000000000001e181 < z

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified78.1%

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

    if -9.5000000000000006e-40 < z < 7e8

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

    if 4.7e142 < z < 1.20000000000000001e181

    1. Initial program 99.7%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in70.3%

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

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

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

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

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

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

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

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

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

Alternative 7: 61.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq 4.8 \cdot 10^{+164}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;t \leq 3 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.59999999999999993e184 or 4.80000000000000021e164 < t < 2.99999999999999975e226

    1. Initial program 96.0%

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

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

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

    if -2.59999999999999993e184 < t < 4.80000000000000021e164

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified71.8%

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

    if 2.99999999999999975e226 < t < 1.39999999999999988e303

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    11. Simplified61.0%

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

    if 1.39999999999999988e303 < t

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{z}{y}}} \]
      3. associate-/r/100.0%

        \[\leadsto -\color{blue}{\frac{t}{z} \cdot y} \]
      4. distribute-rgt-neg-in100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{+184}:\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{+164}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+226}:\\ \;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;t \leq 1.4 \cdot 10^{+303}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-\frac{t}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.8% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := -\frac{t}{\frac{z}{y}}\\
\mathbf{if}\;t \leq -3.35 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+182}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;t \leq 1.12 \cdot 10^{+223}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 6.5 \cdot 10^{+226}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -3.35e184 or 1.90000000000000006e182 < t < 1.1200000000000001e223

    1. Initial program 95.2%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in61.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{z}{y}}} \]
      3. distribute-neg-frac58.4%

        \[\leadsto \color{blue}{\frac{-t}{\frac{z}{y}}} \]
    12. Simplified58.4%

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

    if -3.35e184 < t < 1.90000000000000006e182

    1. Initial program 99.8%

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

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

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

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

    if 1.1200000000000001e223 < t < 6.49999999999999955e226

    1. Initial program 100.0%

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

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

    if 6.49999999999999955e226 < t

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z - t}{a} \cdot y} \]
      4. distribute-rgt-neg-out50.9%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    11. Simplified57.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.35 \cdot 10^{+184}:\\ \;\;\;\;-\frac{t}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+182}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{+223}:\\ \;\;\;\;-\frac{t}{\frac{z}{y}}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+226}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-41} \lor \neg \left(z \leq 2.3 \cdot 10^{+25}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.2e-41 or 2.2999999999999998e25 < z

    1. Initial program 99.9%

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

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

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

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

    if -7.2e-41 < z < 2.2999999999999998e25

    1. Initial program 96.6%

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

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

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

Alternative 10: 76.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.0000000000000002e-40 or 130 < z

    1. Initial program 99.9%

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

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

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

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

    if -9.0000000000000002e-40 < z < 130

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

Alternative 11: 61.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+246} \lor \neg \left(t \leq 2.8 \cdot 10^{+226}\right):\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.6e246 or 2.8000000000000003e226 < t

    1. Initial program 89.2%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a}} \]
      5. /-rgt-identity73.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    11. Simplified63.6%

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

    if -3.6e246 < t < 2.8000000000000003e226

    1. Initial program 99.5%

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

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

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

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

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

Alternative 12: 61.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq 5.5 \cdot 10^{+225}:\\
\;\;\;\;y + x\\

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


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

    1. Initial program 96.6%

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

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

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

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

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

        \[\leadsto x + \frac{\color{blue}{-y \cdot t}}{z} \]
      4. distribute-rgt-neg-in62.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{t}{\frac{z}{y}}} \]
      3. associate-/r/55.1%

        \[\leadsto -\color{blue}{\frac{t}{z} \cdot y} \]
      4. distribute-rgt-neg-in55.1%

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

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

    if -4.2e184 < t < 5.49999999999999985e225

    1. Initial program 99.4%

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

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

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

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

    if 5.49999999999999985e225 < t

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{z - t}{a} \cdot y} \]
      4. distribute-rgt-neg-out50.9%

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}}} \]
    11. Simplified57.2%

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

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

Alternative 13: 98.0% accurate, 1.0× speedup?

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

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

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Final simplification98.4%

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

Alternative 14: 60.1% accurate, 3.7× speedup?

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

\\
y + x
\end{array}
Derivation
  1. Initial program 98.4%

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

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

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

    \[\leadsto \color{blue}{y + x} \]
  6. Final simplification61.6%

    \[\leadsto y + x \]
  7. Add Preprocessing

Alternative 15: 49.9% accurate, 11.0× speedup?

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification47.1%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 98.2% accurate, 1.0× speedup?

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

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

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

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