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

Percentage Accurate: 85.4% → 99.5%
Time: 8.5s
Alternatives: 11
Speedup: 1.0×

Specification

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

\\
x + \frac{y \cdot \left(z - t\right)}{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 11 alternatives:

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

Initial Program: 85.4% accurate, 1.0× speedup?

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

\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}

Alternative 1: 99.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+301} \lor \neg \left(t_1 \leq 4 \cdot 10^{+258}\right):\\
\;\;\;\;x + \frac{z - t}{\frac{a - t}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -2.00000000000000011e301 or 4.00000000000000023e258 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))

    1. Initial program 30.3%

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

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

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

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

    if -2.00000000000000011e301 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 4.00000000000000023e258

    1. Initial program 99.9%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.8%

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

Alternative 2: 93.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+290}\right):\\ \;\;\;\;x + \frac{t - z}{\frac{t}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- a t))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+290)))
     (+ x (/ (- t z) (/ t y)))
     (+ x t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (a - t);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+290)) {
		tmp = x + ((t - z) / (t / y));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (a - t);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+290)) {
		tmp = x + ((t - z) / (t / y));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (a - t)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 1e+290):
		tmp = x + ((t - z) / (t / y))
	else:
		tmp = x + t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+290))
		tmp = Float64(x + Float64(Float64(t - z) / Float64(t / y)));
	else
		tmp = Float64(x + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (a - t);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 1e+290)))
		tmp = x + ((t - z) / (t / y));
	else
		tmp = x + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+290]], $MachinePrecision]], N[(x + N[(N[(t - z), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0 or 1.00000000000000006e290 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))

    1. Initial program 28.5%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in a around 0 26.3%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{z - t}{\frac{t}{y}}} \]
    4. Simplified77.3%

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 1.00000000000000006e290

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.2%

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

Alternative 3: 86.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t \leq 6400000000:\\
\;\;\;\;x + \frac{1}{\frac{\frac{a - t}{y}}{z}}\\

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


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

    1. Initial program 71.2%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in a around 0 68.9%

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

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

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

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

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

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

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

    if -4.8000000000000004e59 < t < 6.4e9

    1. Initial program 93.4%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Step-by-step derivation
      1. clear-num93.4%

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

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

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

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

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

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

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

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

    if 6.4e9 < t

    1. Initial program 57.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in z around 0 54.8%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t \cdot y}{a - t}} \]
      7. *-commutative54.8%

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

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

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

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

Alternative 4: 87.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+119} \lor \neg \left(t \leq 15000000000\right):\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.00000000000000039e119 or 1.5e10 < t

    1. Initial program 61.4%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Step-by-step derivation
      1. +-commutative61.4%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)} \]
    3. Simplified95.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)} \]
    4. Step-by-step derivation
      1. fma-udef95.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a - t}} \]
    8. Simplified91.4%

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

    if -9.00000000000000039e119 < t < 1.5e10

    1. Initial program 93.2%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in z around inf 84.7%

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

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

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

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

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

Alternative 5: 85.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.59999999999999993e112 or 3e115 < t

    1. Initial program 54.5%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in t around inf 88.4%

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

    if -1.59999999999999993e112 < t < 3e115

    1. Initial program 92.9%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in z around inf 83.4%

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

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

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

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

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

Alternative 6: 87.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+112}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\

\mathbf{elif}\;t \leq 2500000000000:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\

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


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

    1. Initial program 67.1%

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)} \]
    3. Simplified91.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)} \]
    4. Step-by-step derivation
      1. fma-udef91.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot \frac{t}{a - t}} \]
    8. Simplified89.0%

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

    if -1.59999999999999993e112 < t < 2.5e12

    1. Initial program 93.2%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in z around inf 84.7%

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

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

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

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

    if 2.5e12 < t

    1. Initial program 57.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in z around 0 54.8%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t \cdot y}{a - t}} \]
      7. *-commutative54.8%

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

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

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

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

Alternative 7: 87.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 71.2%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in a around 0 68.9%

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

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

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

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

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

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

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

    if -5.5999999999999996e59 < t < 7e14

    1. Initial program 93.4%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in z around inf 86.3%

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

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

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

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

    if 7e14 < t

    1. Initial program 57.8%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in z around 0 54.8%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t \cdot y}{a - t}} \]
      7. *-commutative54.8%

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

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

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

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

Alternative 8: 77.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+20}:\\
\;\;\;\;y + x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2e20 or 6.5999999999999996e-14 < t

    1. Initial program 66.2%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in t around inf 80.4%

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

    if -2e20 < t < 6.5999999999999996e-14

    1. Initial program 94.2%

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

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

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

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

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

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

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

Alternative 9: 98.2% accurate, 1.0× speedup?

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

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

    \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
  2. Step-by-step derivation
    1. +-commutative78.7%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)} \]
  3. Simplified96.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)} \]
  4. Step-by-step derivation
    1. fma-udef96.0%

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

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

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

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

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

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

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

Alternative 10: 63.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-161}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;t \leq 8.4 \cdot 10^{-19}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.29999999999999998e-161 or 8.3999999999999996e-19 < t

    1. Initial program 69.9%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in t around inf 76.1%

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

    if -1.29999999999999998e-161 < t < 8.3999999999999996e-19

    1. Initial program 95.6%

      \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
    2. Taylor expanded in x around inf 56.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.3 \cdot 10^{-161}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;t \leq 8.4 \cdot 10^{-19}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]

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

    \[x + \frac{y \cdot \left(z - t\right)}{a - t} \]
  2. Taylor expanded in x around inf 49.5%

    \[\leadsto \color{blue}{x} \]
  3. Final simplification49.5%

    \[\leadsto x \]

Developer target: 98.3% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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