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

Percentage Accurate: 98.1% → 98.1%
Time: 9.6s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 98.1% accurate, 1.0× speedup?

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

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

Alternative 1: 98.1% accurate, 1.0× speedup?

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

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

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

Alternative 2: 75.2% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.2999999999999997e51 or 1.0999999999999999e152 < z

    1. Initial program 99.9%

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

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

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

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

    if -3.2999999999999997e51 < z < 3.5000000000000003e-141

    1. Initial program 95.1%

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

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

    if 3.5000000000000003e-141 < z < 1.0999999999999999e152

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 87.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -246000 or 8.80000000000000023e-58 < t

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{y} \cdot \frac{-t}{z - a} \]
      8. distribute-neg-frac84.6%

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

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

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

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

        \[\leadsto x + y \cdot \frac{t}{0 - \color{blue}{\left(\left(-a\right) + z\right)}} \]
      13. associate--r+84.6%

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

        \[\leadsto x + y \cdot \frac{t}{\color{blue}{\left(-\left(-a\right)\right)} - z} \]
      15. remove-double-neg84.6%

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

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

    if -246000 < t < 8.80000000000000023e-58

    1. Initial program 97.7%

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

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

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

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

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

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

Alternative 4: 87.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.09999999999999978e64 or 8.20000000000000003e80 < z

    1. Initial program 99.9%

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

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

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

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

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

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

    if -4.09999999999999978e64 < z < 8.20000000000000003e80

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{t}{0 - \color{blue}{\left(\left(-a\right) + z\right)}} \]
      13. associate--r+83.3%

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

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

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

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

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

Alternative 5: 81.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4e53 or 1.40000000000000001e-62 < z

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.4e53 < z < 1.40000000000000001e-62

    1. Initial program 92.5%

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

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

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

Alternative 6: 87.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\

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

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


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

    1. Initial program 95.0%

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

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

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

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

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

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

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

    if -2.89999999999999991 < t < 6.49999999999999964e-58

    1. Initial program 97.7%

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

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

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

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

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

    if 6.49999999999999964e-58 < t

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{t}{0 - \color{blue}{\left(\left(-a\right) + z\right)}} \]
      13. associate--r+85.4%

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

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

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

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

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

Alternative 7: 87.6% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

    if -3.7000000000000002e51 < z < 1.25e81

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{t}{0 - \color{blue}{\left(\left(-a\right) + z\right)}} \]
      13. associate--r+83.3%

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

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

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

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

    if 1.25e81 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

Alternative 8: 75.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+51} \lor \neg \left(z \leq 1.2 \cdot 10^{+66}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6000000000000001e51 or 1.2000000000000001e66 < z

    1. Initial program 99.9%

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

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

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

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

    if -2.6000000000000001e51 < z < 1.2000000000000001e66

    1. Initial program 94.1%

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

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

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

Alternative 9: 76.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+72} \lor \neg \left(z \leq 1.22 \cdot 10^{+69}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.90000000000000003e72 or 1.22e69 < z

    1. Initial program 99.9%

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

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

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

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

    if -1.90000000000000003e72 < z < 1.22e69

    1. Initial program 94.1%

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

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

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

Alternative 10: 64.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+52} \lor \neg \left(z \leq 3.8 \cdot 10^{-69}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.55e52 or 3.7999999999999998e-69 < z

    1. Initial program 99.9%

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

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

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

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

    if -1.55e52 < z < 3.7999999999999998e-69

    1. Initial program 92.5%

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

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

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

Alternative 11: 54.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+212}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+131}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -1.55e+212) y (if (<= y 1.55e+131) x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.55e+212) {
		tmp = y;
	} else if (y <= 1.55e+131) {
		tmp = x;
	} else {
		tmp = 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 (y <= (-1.55d+212)) then
        tmp = y
    else if (y <= 1.55d+131) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -1.55e+212) {
		tmp = y;
	} else if (y <= 1.55e+131) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -1.55e+212:
		tmp = y
	elif y <= 1.55e+131:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -1.55e+212)
		tmp = y;
	elseif (y <= 1.55e+131)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -1.55e+212)
		tmp = y;
	elseif (y <= 1.55e+131)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.55e+212], y, If[LessEqual[y, 1.55e+131], x, y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+212}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+131}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.54999999999999999e212 or 1.55000000000000008e131 < y

    1. Initial program 99.9%

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

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

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

      \[\leadsto \color{blue}{y + x} \]
    6. Taylor expanded in y around inf 34.8%

      \[\leadsto \color{blue}{y \cdot \left(1 + \frac{x}{y}\right)} \]
    7. Taylor expanded in y around inf 30.5%

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

    if -1.54999999999999999e212 < y < 1.55000000000000008e131

    1. Initial program 95.6%

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

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

Alternative 12: 52.2% 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 96.6%

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

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

Developer Target 1: 98.1% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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