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

Percentage Accurate: 98.2% → 98.3%
Time: 10.5s
Alternatives: 11
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 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: 98.2% 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.3% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 2: 73.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -6 \cdot 10^{-196}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.60000000000000001e77 or 8.80000000000000056e117 < z

    1. Initial program 99.9%

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

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

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

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

    if -5.60000000000000001e77 < z < -6e-196

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6e-196 < z < 8.80000000000000056e117

    1. Initial program 96.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+77}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-196}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 8.8 \cdot 10^{+117}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 87.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.44999999999999997e35 or 8.80000000000000056e117 < z

    1. Initial program 99.9%

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

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

    if -1.44999999999999997e35 < z < 8.80000000000000056e117

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.6% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.05000000000000006e36 or 2.49999999999999986e118 < z

    1. Initial program 99.9%

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

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

    if -2.05000000000000006e36 < z < 2.49999999999999986e118

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 83.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+149} \lor \neg \left(z \leq 9 \cdot 10^{+117}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.15000000000000008e149 or 9e117 < z

    1. Initial program 99.9%

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

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

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

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

    if -2.15000000000000008e149 < z < 9e117

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 87.6% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

    if -5.69999999999999993e35 < z < 5.2e52

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2e52 < z

    1. Initial program 99.9%

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

        \[\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 t around 0 95.7%

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

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

Alternative 7: 76.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+23} \lor \neg \left(z \leq 8.8 \cdot 10^{+117}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.49999999999999987e23 or 8.80000000000000056e117 < z

    1. Initial program 99.9%

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

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

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

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

    if -7.49999999999999987e23 < z < 8.80000000000000056e117

    1. Initial program 95.5%

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

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

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

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

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

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

Alternative 8: 75.9% accurate, 0.6× speedup?

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

    1. Initial program 99.9%

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

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

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

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

    if -4.9999999999999999e23 < z < 9e117

    1. Initial program 95.5%

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

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

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

Alternative 9: 98.2% 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 97.3%

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

Alternative 10: 61.8% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.4000000000000005e155

    1. Initial program 96.8%

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

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

    if -4.4000000000000005e155 < a

    1. Initial program 97.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.4 \cdot 10^{+155}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 49.8% accurate, 11.0× speedup?

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024146 
(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)))))