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

Percentage Accurate: 85.9% → 99.3%
Time: 8.4s
Alternatives: 11
Speedup: 0.5×

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 11 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.9% 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.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+233}:\\ \;\;\;\;t\_1 + x\\ \mathbf{else}:\\ \;\;\;\;x - \frac{1}{\frac{\frac{a - z}{y}}{z - t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (<= t_1 (- INFINITY))
     (fma y (/ (- z t) (- z a)) x)
     (if (<= t_1 5e+233) (+ t_1 x) (- x (/ 1.0 (/ (/ (- a z) y) (- z t))))))))
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)) {
		tmp = fma(y, ((z - t) / (z - a)), x);
	} else if (t_1 <= 5e+233) {
		tmp = t_1 + x;
	} else {
		tmp = x - (1.0 / (((a - z) / y) / (z - t)));
	}
	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))
		tmp = fma(y, Float64(Float64(z - t) / Float64(z - a)), x);
	elseif (t_1 <= 5e+233)
		tmp = Float64(t_1 + x);
	else
		tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(a - z) / y) / Float64(z - t))));
	end
	return 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[LessEqual[t$95$1, (-Infinity)], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+233], N[(t$95$1 + x), $MachinePrecision], N[(x - N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+233}:\\
\;\;\;\;t\_1 + x\\

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


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

    1. Initial program 55.9%

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.00000000000000009e233

    1. Initial program 99.8%

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

    if 5.00000000000000009e233 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 51.1%

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

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

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

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

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

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

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

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

Alternative 2: 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^{+233}\right):\\ \;\;\;\;x - \frac{1}{\frac{\frac{a - z}{y}}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;t\_1 + x\\ \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+233)))
     (- x (/ 1.0 (/ (/ (- a z) y) (- z t))))
     (+ t_1 x))))
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+233)) {
		tmp = x - (1.0 / (((a - z) / y) / (z - t)));
	} else {
		tmp = t_1 + x;
	}
	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+233)) {
		tmp = x - (1.0 / (((a - z) / y) / (z - t)));
	} else {
		tmp = t_1 + x;
	}
	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+233):
		tmp = x - (1.0 / (((a - z) / y) / (z - t)))
	else:
		tmp = t_1 + x
	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+233))
		tmp = Float64(x - Float64(1.0 / Float64(Float64(Float64(a - z) / y) / Float64(z - t))));
	else
		tmp = Float64(t_1 + x);
	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+233)))
		tmp = x - (1.0 / (((a - z) / y) / (z - t)));
	else
		tmp = t_1 + x;
	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+233]], $MachinePrecision]], N[(x - N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $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^{+233}\right):\\
\;\;\;\;x - \frac{1}{\frac{\frac{a - z}{y}}{z - t}}\\

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


\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.00000000000000009e233 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 52.7%

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

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

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

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

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

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

      \[\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.00000000000000009e233

    1. Initial program 99.8%

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

    \[\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^{+233}\right):\\ \;\;\;\;x - \frac{1}{\frac{\frac{a - z}{y}}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a} + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.6% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.1e-24 or 1e16 < z

    1. Initial program 82.4%

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

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

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

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

    if -3.1e-24 < z < 1.4499999999999999e-65

    1. Initial program 97.5%

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

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

    if 1.4499999999999999e-65 < z < 3.7000000000000001e-11

    1. Initial program 99.1%

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

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

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

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

    if 3.7000000000000001e-11 < z < 1e16

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{-24}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-65}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-11}:\\ \;\;\;\;\left(t - z\right) \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 10^{+16}:\\ \;\;\;\;x - \frac{y \cdot z}{a}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 91.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 5.00000000000000009e233

    1. Initial program 96.4%

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

    if 5.00000000000000009e233 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 51.1%

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

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

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

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

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

Alternative 5: 83.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-19} \lor \neg \left(z \leq 1.8 \cdot 10^{+31}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.1999999999999998e-19 or 1.79999999999999998e31 < z

    1. Initial program 82.7%

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

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

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

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

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

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

    if -4.1999999999999998e-19 < z < 1.79999999999999998e31

    1. Initial program 97.0%

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

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

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

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

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

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

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

Alternative 6: 81.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-93} \lor \neg \left(z \leq 2.3 \cdot 10^{-70}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5000000000000002e-93 or 2.30000000000000001e-70 < z

    1. Initial program 85.2%

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

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

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

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

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

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

    if -4.5000000000000002e-93 < z < 2.30000000000000001e-70

    1. Initial program 97.9%

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

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

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

Alternative 7: 75.8% accurate, 0.6× speedup?

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

    1. Initial program 83.8%

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

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

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

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

    if -4.79999999999999988e-18 < z < 7.80000000000000038e-70

    1. Initial program 97.4%

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

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

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

Alternative 8: 76.4% accurate, 0.6× speedup?

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

    1. Initial program 83.8%

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

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

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

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

    if -1.3500000000000001e-22 < z < 1.4499999999999999e-69

    1. Initial program 97.4%

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

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

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

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

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

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

Alternative 9: 64.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-56} \lor \neg \left(z \leq 3.5 \cdot 10^{-46}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.4999999999999991e-56 or 3.5000000000000002e-46 < z

    1. Initial program 84.1%

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

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

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

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

    if -9.4999999999999991e-56 < z < 3.5000000000000002e-46

    1. Initial program 98.1%

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

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

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

Alternative 10: 53.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 7.5 \cdot 10^{-179}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.50000000000000038e-76 or 7.4999999999999996e-179 < x

    1. Initial program 91.6%

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

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

    if -8.50000000000000038e-76 < x < 7.4999999999999996e-179

    1. Initial program 86.6%

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

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

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

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

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

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

Alternative 11: 50.8% 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 90.2%

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

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

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

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

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