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

Percentage Accurate: 85.7% → 98.1%
Time: 9.3s
Alternatives: 11
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 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.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.1% 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 83.5%

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

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

    \[\leadsto \color{blue}{x + \frac{y - z}{a - z} \cdot t} \]
  4. Add Preprocessing
  5. Final simplification97.4%

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

Alternative 2: 83.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+82} \lor \neg \left(z \leq 3.2 \cdot 10^{-7}\right) \land \left(z \leq 3.6 \cdot 10^{+129} \lor \neg \left(z \leq 2.6 \cdot 10^{+175}\right)\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.8e+82)
         (and (not (<= z 3.2e-7)) (or (<= z 3.6e+129) (not (<= z 2.6e+175)))))
   (+ x t)
   (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.8e+82) || (!(z <= 3.2e-7) && ((z <= 3.6e+129) || !(z <= 2.6e+175)))) {
		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.8d+82)) .or. (.not. (z <= 3.2d-7)) .and. (z <= 3.6d+129) .or. (.not. (z <= 2.6d+175))) 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.8e+82) || (!(z <= 3.2e-7) && ((z <= 3.6e+129) || !(z <= 2.6e+175)))) {
		tmp = x + t;
	} else {
		tmp = x + (y * (t / (a - z)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -1.8e+82) or (not (z <= 3.2e-7) and ((z <= 3.6e+129) or not (z <= 2.6e+175))):
		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.8e+82) || (!(z <= 3.2e-7) && ((z <= 3.6e+129) || !(z <= 2.6e+175))))
		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.8e+82) || (~((z <= 3.2e-7)) && ((z <= 3.6e+129) || ~((z <= 2.6e+175)))))
		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.8e+82], And[N[Not[LessEqual[z, 3.2e-7]], $MachinePrecision], Or[LessEqual[z, 3.6e+129], N[Not[LessEqual[z, 2.6e+175]], $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.8 \cdot 10^{+82} \lor \neg \left(z \leq 3.2 \cdot 10^{-7}\right) \land \left(z \leq 3.6 \cdot 10^{+129} \lor \neg \left(z \leq 2.6 \cdot 10^{+175}\right)\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.80000000000000007e82 or 3.2000000000000001e-7 < z < 3.6000000000000001e129 or 2.6e175 < z

    1. Initial program 67.6%

      \[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. Add Preprocessing
    5. Taylor expanded in z around inf 80.6%

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

    if -1.80000000000000007e82 < z < 3.2000000000000001e-7 or 3.6000000000000001e129 < z < 2.6e175

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+82} \lor \neg \left(z \leq 3.2 \cdot 10^{-7}\right) \land \left(z \leq 3.6 \cdot 10^{+129} \lor \neg \left(z \leq 2.6 \cdot 10^{+175}\right)\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 83.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+79} \lor \neg \left(z \leq 3.2 \cdot 10^{-7}\right) \land \left(z \leq 2.65 \cdot 10^{+126} \lor \neg \left(z \leq 3.1 \cdot 10^{+174}\right)\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.40000000000000032e79 or 3.2000000000000001e-7 < z < 2.65000000000000014e126 or 3.1e174 < z

    1. Initial program 67.6%

      \[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. Add Preprocessing
    5. Taylor expanded in z around inf 80.6%

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

    if -3.40000000000000032e79 < z < 3.2000000000000001e-7 or 2.65000000000000014e126 < z < 3.1e174

    1. Initial program 93.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+79} \lor \neg \left(z \leq 3.2 \cdot 10^{-7}\right) \land \left(z \leq 2.65 \cdot 10^{+126} \lor \neg \left(z \leq 3.1 \cdot 10^{+174}\right)\right):\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.3% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+126} \lor \neg \left(z \leq 2.9 \cdot 10^{+175}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.8000000000000002e81 or 3.2000000000000001e-7 < z < 1.40000000000000005e126 or 2.9e175 < z

    1. Initial program 67.6%

      \[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. Add Preprocessing
    5. Taylor expanded in z around inf 80.6%

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

    if -7.8000000000000002e81 < z < 3.2000000000000001e-7

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

    if 1.40000000000000005e126 < z < 2.9e175

    1. Initial program 82.4%

      \[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. Add Preprocessing
    5. Taylor expanded in y around inf 64.4%

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

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

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

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

Alternative 5: 87.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+80} \lor \neg \left(z \leq 5.1 \cdot 10^{-44}\right):\\
\;\;\;\;x - t \cdot \left(\frac{y}{z} + -1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.10000000000000001e80 or 5.1000000000000005e-44 < z

    1. Initial program 70.7%

      \[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. Add Preprocessing
    5. Taylor expanded in a around 0 82.9%

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

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

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

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

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

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

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

    if -1.10000000000000001e80 < z < 5.1000000000000005e-44

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

Alternative 6: 87.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.11999999999999998e82 or 2.49999999999999989e-7 < z

    1. Initial program 69.1%

      \[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. Add Preprocessing
    5. Taylor expanded in y around 0 63.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{-t}{\frac{a - z}{z}}} \]
      4. div-sub90.1%

        \[\leadsto x + \frac{-t}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      5. *-inverses90.1%

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

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

    if -1.11999999999999998e82 < z < 2.49999999999999989e-7

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

Alternative 7: 76.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+17} \lor \neg \left(z \leq 4.1 \cdot 10^{-8}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.5e17 or 4.10000000000000032e-8 < z

    1. Initial program 70.6%

      \[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. Add Preprocessing
    5. Taylor expanded in z around inf 73.9%

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

    if -2.5e17 < z < 4.10000000000000032e-8

    1. Initial program 95.3%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
      2. associate-/r/80.8%

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

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

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

Alternative 8: 76.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -310 \lor \neg \left(z \leq 5.1 \cdot 10^{-8}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -310 or 5.10000000000000001e-8 < z

    1. Initial program 70.6%

      \[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. Add Preprocessing
    5. Taylor expanded in z around inf 73.9%

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

    if -310 < z < 5.10000000000000001e-8

    1. Initial program 95.3%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
      2. associate-/r/80.8%

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{t}}} \]
      3. un-div-inv80.8%

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

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

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

Alternative 9: 95.5% accurate, 1.0× speedup?

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

\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Derivation
  1. Initial program 83.5%

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}} \]
    2. clear-num97.2%

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

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

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

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

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

Alternative 10: 61.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.1 \cdot 10^{+116}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 4.0999999999999998e116

    1. Initial program 84.7%

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

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

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

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

    if 4.0999999999999998e116 < a

    1. Initial program 74.4%

      \[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. Add Preprocessing
    5. Taylor expanded in a around inf 72.4%

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

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

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

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

        \[\leadsto x + \frac{t}{\color{blue}{\frac{-1 \cdot a}{z}}} \]
      2. neg-mul-175.9%

        \[\leadsto x + \frac{t}{\frac{\color{blue}{-a}}{z}} \]
    10. Simplified75.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 4.1 \cdot 10^{+116}:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 51.1% 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 83.5%

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

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

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

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

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

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

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

      \[\leadsto x + \frac{t}{\color{blue}{\frac{-1 \cdot a}{z}}} \]
    2. neg-mul-146.4%

      \[\leadsto x + \frac{t}{\frac{\color{blue}{-a}}{z}} \]
  10. Simplified46.4%

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

    \[\leadsto \color{blue}{x} \]
  12. Final simplification48.7%

    \[\leadsto x \]
  13. Add Preprocessing

Developer target: 99.2% accurate, 0.5× 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 2024021 
(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))))