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

Percentage Accurate: 85.6% → 99.3%
Time: 11.8s
Alternatives: 14
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 85.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.3% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 29.7%

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.0000000000000003e240

    1. Initial program 99.9%

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

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

Alternative 2: 97.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto \mathsf{fma}\left(y, \color{blue}{{\left(\frac{z - a}{z - t}\right)}^{-1}}, x\right) \]
  7. Step-by-step derivation
    1. unpow-199.2%

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

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

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

Alternative 3: 97.9% 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 81.5%

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

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

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

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

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

Alternative 4: 76.3% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.44999999999999997e125 or 8.20000000000000003e-47 < z

    1. Initial program 68.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified77.2%

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

    if -1.44999999999999997e125 < z < -5.5999999999999996e59

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5999999999999996e59 < z < 8.20000000000000003e-47

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x - \frac{y}{\color{blue}{-1 \cdot \frac{a}{t}}} \]
    11. Step-by-step derivation
      1. mul-1-neg82.3%

        \[\leadsto x - \frac{y}{\color{blue}{-\frac{a}{t}}} \]
      2. distribute-neg-frac282.3%

        \[\leadsto x - \frac{y}{\color{blue}{\frac{a}{-t}}} \]
    12. Simplified82.3%

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

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

Alternative 5: 76.5% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.6999999999999999e125 or 8.20000000000000003e-47 < z

    1. Initial program 68.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified77.2%

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

    if -1.6999999999999999e125 < z < -4.3999999999999999e59

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.3999999999999999e59 < z < 8.20000000000000003e-47

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 93.3% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 55.4%

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

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

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

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

    if -7.5999999999999996e101 < z < 3.6e140

    1. Initial program 93.8%

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

    if 3.6e140 < z

    1. Initial program 45.7%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z - t}{z}} \]
      2. div-sub96.8%

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

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

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

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

Alternative 7: 86.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.5e79 or 2.4999999999999999e134 < t

    1. Initial program 76.5%

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

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

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

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

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

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

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

    if -2.5e79 < t < 2.4999999999999999e134

    1. Initial program 83.8%

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

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

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

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

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

Alternative 8: 85.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{+81} \lor \neg \left(t \leq 3.05 \cdot 10^{+134}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.0000000000000001e81 or 3.04999999999999989e134 < t

    1. Initial program 76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{y \cdot \frac{-t}{z - a}} \]
      11. add-sqr-sqrt14.1%

        \[\leadsto x - y \cdot \frac{\color{blue}{\sqrt{-t} \cdot \sqrt{-t}}}{z - a} \]
      12. sqrt-unprod17.9%

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

        \[\leadsto x - y \cdot \frac{\sqrt{\color{blue}{t \cdot t}}}{z - a} \]
      14. sqrt-unprod43.4%

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

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

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

    if -7.0000000000000001e81 < t < 3.04999999999999989e134

    1. Initial program 83.8%

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

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

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

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

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

Alternative 9: 82.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{-13} \lor \neg \left(z \leq 1.08 \cdot 10^{-76}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.80000000000000009e-13 or 1.08e-76 < z

    1. Initial program 73.8%

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

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

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

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

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

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

    if -7.80000000000000009e-13 < z < 1.08e-76

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \frac{y}{\color{blue}{-\frac{a}{t}}} \]
      2. distribute-neg-frac287.1%

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

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

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

Alternative 10: 82.0% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.29999999999999985e-115

    1. Initial program 77.4%

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

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

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

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

    if -2.29999999999999985e-115 < z < 2.55000000000000016e-77

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.55000000000000016e-77 < z

    1. Initial program 74.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 82.1% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.9499999999999999e-115

    1. Initial program 77.4%

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

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

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

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

    if -1.9499999999999999e-115 < z < 1.08e-76

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.08e-76 < z

    1. Initial program 74.3%

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

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

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

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

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

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

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

Alternative 12: 76.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{-20} \lor \neg \left(z \leq 45000000000000\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 -1.9e-20) (not (<= z 45000000000000.0)))
   (+ y x)
   (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.9e-20) || !(z <= 45000000000000.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 <= (-1.9d-20)) .or. (.not. (z <= 45000000000000.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 <= -1.9e-20) || !(z <= 45000000000000.0)) {
		tmp = y + x;
	} else {
		tmp = x + ((y * t) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -1.9e-20) or not (z <= 45000000000000.0):
		tmp = y + x
	else:
		tmp = x + ((y * t) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -1.9e-20) || !(z <= 45000000000000.0))
		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 <= -1.9e-20) || ~((z <= 45000000000000.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, -1.9e-20], N[Not[LessEqual[z, 45000000000000.0]], $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 -1.9 \cdot 10^{-20} \lor \neg \left(z \leq 45000000000000\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 < -1.8999999999999999e-20 or 4.5e13 < z

    1. Initial program 70.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified75.4%

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

    if -1.8999999999999999e-20 < z < 4.5e13

    1. Initial program 97.3%

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

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

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

Alternative 13: 63.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq 3.2 \cdot 10^{+201}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.2000000000000002e147 or 3.1999999999999999e201 < a

    1. Initial program 85.8%

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

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

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

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

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

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

    if -2.2000000000000002e147 < a < 3.1999999999999999e201

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

Alternative 14: 50.3% accurate, 11.0× speedup?

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

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

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

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

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

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

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

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

Developer Target 1: 98.0% 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 2024185 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

  :alt
  (! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))

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