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

Percentage Accurate: 85.7% → 98.4%
Time: 8.5s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 86.5% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{+48} \lor \neg \left(z \leq 3 \cdot 10^{+86}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.50000000000000027e44 or 9.00000000000000081e-37 < z < 1.1e48 or 2.99999999999999977e86 < z

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.50000000000000027e44 < z < 9.00000000000000081e-37

    1. Initial program 91.8%

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

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

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

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

    if 1.1e48 < z < 2.99999999999999977e86

    1. Initial program 76.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{a}{t}}} + x \]
      3. clear-num100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+44}:\\ \;\;\;\;x + \left(t - t \cdot \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-37}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{+48} \lor \neg \left(z \leq 3 \cdot 10^{+86}\right):\\ \;\;\;\;x + \left(t - t \cdot \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 3: 86.5% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+46} \lor \neg \left(z \leq 4 \cdot 10^{+86}\right):\\
\;\;\;\;x - \frac{t}{\frac{z}{y - z}}\\

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


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

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.50000000000000015e47 < z < 9.49999999999999927e-37

    1. Initial program 91.8%

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

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

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

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

    if 9.49999999999999927e-37 < z < 2.60000000000000013e46 or 4.0000000000000001e86 < z

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t}{\frac{z}{y - z}}} \]
    6. Simplified90.8%

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

    if 2.60000000000000013e46 < z < 4.0000000000000001e86

    1. Initial program 76.5%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{a}{t}}} + x \]
      3. clear-num100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+47}:\\ \;\;\;\;x + \left(t - t \cdot \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-37}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+46} \lor \neg \left(z \leq 4 \cdot 10^{+86}\right):\\ \;\;\;\;x - \frac{t}{\frac{z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]

Alternative 4: 75.1% accurate, 0.7× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.6999999999999999e55 or 1.70000000000000009e90 < z

    1. Initial program 70.9%

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

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

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

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

    if -1.6999999999999999e55 < z < 8.80000000000000008e-37

    1. Initial program 91.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    6. Simplified77.2%

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

    if 8.80000000000000008e-37 < z < 1.4500000000000001e34

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 - \frac{y}{z}\right) \cdot t} \]
    11. Step-by-step derivation
      1. sub-neg66.2%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y}{z} \cdot t} \]
      5. *-commutative66.2%

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

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

    if 1.4500000000000001e34 < z < 1.70000000000000009e90

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+55}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{-37}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+34}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+90}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 5: 75.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+43}:\\
\;\;\;\;x + t\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.49999999999999989e43 or 2.9999999999999999e87 < z

    1. Initial program 70.9%

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

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

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

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

    if -5.49999999999999989e43 < z < 9.49999999999999927e-37

    1. Initial program 91.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    6. Simplified77.2%

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

    if 9.49999999999999927e-37 < z < 1.1499999999999999e34

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1499999999999999e34 < z < 2.9999999999999999e87

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+43}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-37}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+34}:\\ \;\;\;\;t - \frac{y \cdot t}{z}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+87}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 6: 84.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+56} \lor \neg \left(z \leq 6 \cdot 10^{+169}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35000000000000005e56 or 5.9999999999999999e169 < z

    1. Initial program 69.4%

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

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

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

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

    if -1.35000000000000005e56 < z < 5.9999999999999999e169

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+56} \lor \neg \left(z \leq 6 \cdot 10^{+169}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \end{array} \]

Alternative 7: 84.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+56} \lor \neg \left(z \leq 7.6 \cdot 10^{+175}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.35000000000000005e56 or 7.5999999999999994e175 < z

    1. Initial program 68.9%

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

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

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

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

    if -1.35000000000000005e56 < z < 7.5999999999999994e175

    1. Initial program 90.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{+56} \lor \neg \left(z \leq 7.6 \cdot 10^{+175}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \end{array} \]

Alternative 8: 86.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5000000000000001e-100 or 1.5599999999999999e78 < y

    1. Initial program 81.4%

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

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

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

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

    if -4.5000000000000001e-100 < y < 1.5599999999999999e78

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(-\color{blue}{\frac{t}{\frac{a - z}{z}}}\right) \]
    8. Simplified93.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-100} \lor \neg \left(y \leq 1.56 \cdot 10^{+78}\right):\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{t}{\frac{a - z}{z}}\\ \end{array} \]

Alternative 9: 77.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+46} \lor \neg \left(z \leq 2.2 \cdot 10^{+86}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.3000000000000001e46 or 2.20000000000000003e86 < z

    1. Initial program 70.9%

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

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

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

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

    if -2.3000000000000001e46 < z < 2.20000000000000003e86

    1. Initial program 91.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+46} \lor \neg \left(z \leq 2.2 \cdot 10^{+86}\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]

Alternative 10: 77.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+50}:\\
\;\;\;\;x + t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2000000000000001e50 or 2.1500000000000001e86 < z

    1. Initial program 70.9%

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

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

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

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

    if -1.2000000000000001e50 < z < 2.1500000000000001e86

    1. Initial program 91.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{t}}} + x \]
    6. Simplified73.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+50}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+86}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 11: 58.5% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+106}:\\
\;\;\;\;t \cdot \frac{-y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.10000000000000005e106

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{y \cdot t}{z}} \]
      2. *-commutative43.6%

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

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

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

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

    if -2.10000000000000005e106 < y

    1. Initial program 86.1%

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

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

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

      \[\leadsto x + \color{blue}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+106}:\\ \;\;\;\;t \cdot \frac{-y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 12: 62.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-235}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e19 or 2.19999999999999984e-235 < z

    1. Initial program 82.0%

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

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

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

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

    if -1.7e19 < z < 2.19999999999999984e-235

    1. Initial program 90.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+19}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-235}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]

Alternative 13: 50.5% 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 85.2%

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification46.4%

    \[\leadsto x \]

Developer target: 99.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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