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

Percentage Accurate: 98.1% → 98.1%
Time: 9.0s
Alternatives: 10
Speedup: 1.0×

Specification

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

\\
x + y \cdot \frac{z - t}{a - t}
\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 10 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}{a - t} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (a - t)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 98.1% accurate, 1.0× speedup?

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

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

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

Alternative 2: 87.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+45} \lor \neg \left(t \leq 2.55 \cdot 10^{+39}\right):\\
\;\;\;\;x + y \cdot \frac{t - z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.3000000000000001e45 or 2.5499999999999999e39 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3000000000000001e45 < t < 2.5499999999999999e39

    1. Initial program 97.5%

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

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

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

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

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

Alternative 3: 83.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+140} \lor \neg \left(t \leq 4.3 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.99999999999999993e140 or 4.2999999999999999e49 < t

    1. Initial program 99.9%

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

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

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

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

    if -5.99999999999999993e140 < t < 4.2999999999999999e49

    1. Initial program 97.7%

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

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

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

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

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

Alternative 4: 86.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto x - y \cdot \color{blue}{\left(\frac{z}{t} - \frac{t}{t}\right)} \]
      5. sub-neg90.2%

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

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

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

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

    if -2.09999999999999995e45 < t < 1.4e-57

    1. Initial program 97.0%

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

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

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

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

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

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

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

    if 1.4e-57 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a}{t}}} + x \]
      3. div-sub87.9%

        \[\leadsto \frac{y}{\color{blue}{\frac{t}{t} - \frac{a}{t}}} + x \]
      4. *-inverses87.9%

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

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

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

Alternative 5: 86.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{\color{blue}{\left(-\left(-t\right)\right)} - z}{t} \]
      10. remove-double-neg90.1%

        \[\leadsto x + y \cdot \frac{\color{blue}{t} - z}{t} \]
    5. Simplified90.1%

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

    if -8.8000000000000001e45 < t < 1.29999999999999993e-57

    1. Initial program 97.0%

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

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

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

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

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

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

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

    if 1.29999999999999993e-57 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{t - a}{t}}} + x \]
      3. div-sub87.9%

        \[\leadsto \frac{y}{\color{blue}{\frac{t}{t} - \frac{a}{t}}} + x \]
      4. *-inverses87.9%

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

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

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

Alternative 6: 86.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + y \cdot \frac{\color{blue}{\left(-\left(-t\right)\right)} - z}{t} \]
      10. remove-double-neg90.1%

        \[\leadsto x + y \cdot \frac{\color{blue}{t} - z}{t} \]
    5. Simplified90.1%

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

    if -2.69999999999999984e45 < t < 1.4e-57

    1. Initial program 97.0%

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

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

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

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

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

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

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

    if 1.4e-57 < t

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+45} \lor \neg \left(t \leq 6.8 \cdot 10^{+38}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.9999999999999997e45 or 6.79999999999999992e38 < t

    1. Initial program 99.9%

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

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

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

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

    if -3.9999999999999997e45 < t < 6.79999999999999992e38

    1. Initial program 97.5%

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

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

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

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

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

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

Alternative 8: 77.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+44} \lor \neg \left(t \leq 1.65 \cdot 10^{+39}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.5e44 or 1.6500000000000001e39 < t

    1. Initial program 99.9%

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

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

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

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

    if -4.5e44 < t < 1.6500000000000001e39

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

Alternative 9: 64.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+44} \lor \neg \left(t \leq 1.4 \cdot 10^{-92}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.30000000000000013e44 or 1.4e-92 < t

    1. Initial program 99.9%

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

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

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

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

    if -3.30000000000000013e44 < t < 1.4e-92

    1. Initial program 96.8%

      \[x + y \cdot \frac{z - t}{a - t} \]
    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 simplification61.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{+44} \lor \neg \left(t \leq 1.4 \cdot 10^{-92}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 51.5% accurate, 11.0× speedup?

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

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

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

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

Developer Target 1: 99.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \frac{z - t}{a - t}\\ \mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
   (if (< y -8.508084860551241e-17)
     t_1
     (if (< y 2.894426862792089e-49)
       (+ x (* (* y (- z t)) (/ 1.0 (- a t))))
       t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * ((z - t) / (a - t)));
	double tmp;
	if (y < -8.508084860551241e-17) {
		tmp = t_1;
	} else if (y < 2.894426862792089e-49) {
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
	} 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 - t) / (a - t)))
    if (y < (-8.508084860551241d-17)) then
        tmp = t_1
    else if (y < 2.894426862792089d-49) then
        tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
    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 - t) / (a - t)));
	double tmp;
	if (y < -8.508084860551241e-17) {
		tmp = t_1;
	} else if (y < 2.894426862792089e-49) {
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * ((z - t) / (a - t)))
	tmp = 0
	if y < -8.508084860551241e-17:
		tmp = t_1
	elif y < 2.894426862792089e-49:
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t))))
	tmp = 0.0
	if (y < -8.508084860551241e-17)
		tmp = t_1;
	elseif (y < 2.894426862792089e-49)
		tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * ((z - t) / (a - t)));
	tmp = 0.0;
	if (y < -8.508084860551241e-17)
		tmp = t_1;
	elseif (y < 2.894426862792089e-49)
		tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\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, B"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))

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