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

Percentage Accurate: 98.2% → 98.8%
Time: 8.2s
Alternatives: 9
Speedup: 0.6×

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 9 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.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000006e136

    1. Initial program 99.4%

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

    if 1.00000000000000006e136 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 81.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Step-by-step derivation
      1. associate-*r/96.2%

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

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

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

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

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

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

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

Alternative 2: 98.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+158}:\\
\;\;\;\;x + t_1 \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 z a)) < 4.9999999999999996e158

    1. Initial program 99.4%

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

    if 4.9999999999999996e158 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{z - a}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-32}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 4 \cdot 10^{-250}:\\
\;\;\;\;x - \frac{t \cdot y}{z - a}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.1999999999999998e-32 or 1.7499999999999999e58 < z

    1. Initial program 99.9%

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

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

    if -4.1999999999999998e-32 < z < 4.0000000000000002e-250

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y \cdot t}{z - a}} \]
    9. Applied egg-rr98.6%

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

    if 4.0000000000000002e-250 < z < 1.10000000000000009e-62

    1. Initial program 96.0%

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

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

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

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

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

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

    if 1.10000000000000009e-62 < z < 1.7499999999999999e58

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{-32}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-250}:\\ \;\;\;\;x - \frac{t \cdot y}{z - a}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-62}:\\ \;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+58}:\\ \;\;\;\;x - y \cdot \frac{t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]

Alternative 4: 82.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-77} \lor \neg \left(z \leq 1.6 \cdot 10^{-76}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.0000000000000001e-77 or 1.5999999999999999e-76 < z

    1. Initial program 99.9%

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

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

    if -9.0000000000000001e-77 < z < 1.5999999999999999e-76

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 87.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+119} \lor \neg \left(z \leq 8 \cdot 10^{+55}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.3000000000000002e119 or 8.00000000000000008e55 < z

    1. Initial program 99.9%

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

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

    if -3.3000000000000002e119 < z < 8.00000000000000008e55

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 76.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.5999999999999992e84 or 3.30000000000000023e65 < z

    1. Initial program 99.9%

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

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

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

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

    if -8.5999999999999992e84 < z < 3.30000000000000023e65

    1. Initial program 96.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{+84}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+65}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 7: 76.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e85 or 2.40000000000000002e67 < z

    1. Initial program 99.9%

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

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

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

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

    if -1.5e85 < z < 2.40000000000000002e67

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+85}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+67}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 8: 63.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;z \leq 2.35 \cdot 10^{+67}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6e23 or 2.35000000000000009e67 < z

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified73.6%

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

    if -1.6e23 < z < 2.35000000000000009e67

    1. Initial program 96.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+23}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 2.35 \cdot 10^{+67}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 50.9% 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.6%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification52.6%

    \[\leadsto x \]

Developer target: 98.3% accurate, 1.0× speedup?

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

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

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

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