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

Percentage Accurate: 84.7% → 99.0%
Time: 10.1s
Alternatives: 12
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 84.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-56}:\\
\;\;\;\;x + t\_1\\

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


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

    1. Initial program 28.5%

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e-56

    1. Initial program 99.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing

    if 2.0000000000000001e-56 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{-147}:\\ \;\;\;\;x + \frac{t - z}{\frac{a - z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a - z}, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -1.45e-147)
   (+ x (/ (- t z) (/ (- a z) y)))
   (fma y (/ (- t z) (- a z)) x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -1.45e-147) {
		tmp = x + ((t - z) / ((a - z) / y));
	} else {
		tmp = fma(y, ((t - z) / (a - z)), x);
	}
	return tmp;
}
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -1.45e-147)
		tmp = Float64(x + Float64(Float64(t - z) / Float64(Float64(a - z) / y)));
	else
		tmp = fma(y, Float64(Float64(t - z) / Float64(a - z)), x);
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.45e-147], N[(x + N[(N[(t - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a - z}, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4500000000000001e-147

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if -1.4500000000000001e-147 < x

    1. Initial program 87.6%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.1%

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

Alternative 3: 99.0% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(t - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{-56}\right):\\
\;\;\;\;x + \frac{t - z}{\frac{a - z}{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 z a)) < -inf.0 or 2.0000000000000001e-56 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000001e-56

    1. Initial program 99.2%

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

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

Alternative 4: 96.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(t - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;y \cdot \frac{t - z}{a - z}\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+259}:\\
\;\;\;\;x + t\_1\\

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


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

    1. Initial program 28.5%

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e259

    1. Initial program 99.3%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing

    if 2e259 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 43.0%

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

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

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
    5. Simplified85.5%

      \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.2%

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

Alternative 5: 74.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.7 \cdot 10^{+68}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\

\mathbf{elif}\;z \leq -9.8 \cdot 10^{+23} \lor \neg \left(z \leq 6.6 \cdot 10^{+50}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.75e130 or -1.70000000000000008e68 < z < -9.8000000000000006e23 or 6.6000000000000001e50 < z

    1. Initial program 75.7%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z 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 -1.75e130 < z < -1.70000000000000008e68

    1. Initial program 49.5%

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

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

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

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

    if -9.8000000000000006e23 < z < 6.6000000000000001e50

    1. Initial program 98.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+130}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{+68}:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{z - a}\\ \mathbf{elif}\;z \leq -9.8 \cdot 10^{+23} \lor \neg \left(z \leq 6.6 \cdot 10^{+50}\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t \cdot y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 80.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+27} \lor \neg \left(z \leq 7.2 \cdot 10^{+22}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.3999999999999997e27 or 7.2e22 < z

    1. Initial program 73.9%

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

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

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

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

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

    if -4.3999999999999997e27 < z < 7.2e22

    1. Initial program 99.1%

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

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

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

Alternative 7: 82.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.59999999999999994e-22 or 1.4e6 < a

    1. Initial program 87.4%

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

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

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

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

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

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

    if -1.59999999999999994e-22 < a < 1.4e6

    1. Initial program 86.3%

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

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

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

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

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

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

Alternative 8: 82.6% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.90000000000000012e-22

    1. Initial program 86.5%

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

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

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

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

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

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

    if -1.90000000000000012e-22 < a < 10.5

    1. Initial program 86.3%

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

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

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

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

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

    if 10.5 < a

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{z - a}{y}}{z - t}}} \]
      6. clear-num94.1%

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

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

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

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

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

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

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

Alternative 9: 75.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2199999999999999e28 or 6.5000000000000003e50 < z

    1. Initial program 73.2%

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

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

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

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

    if -1.2199999999999999e28 < z < 6.5000000000000003e50

    1. Initial program 98.4%

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

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

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

Alternative 10: 62.6% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9e19 or 1.05000000000000001e43 < z

    1. Initial program 73.7%

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

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

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

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

    if -1.9e19 < z < 1.05000000000000001e43

    1. Initial program 98.4%

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

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

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

Alternative 11: 49.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 2 \cdot 10^{+187}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a) :precision binary64 (if (<= z 2e+187) x y))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 2e+187) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= 2d+187) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= 2e+187) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= 2e+187:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= 2e+187)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= 2e+187)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 2e+187], x, y]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+187}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.99999999999999981e187

    1. Initial program 89.7%

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

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

    if 1.99999999999999981e187 < z

    1. Initial program 60.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2 \cdot 10^{+187}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 50.3% 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 86.9%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification53.1%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 98.3% accurate, 1.0× speedup?

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

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

Reproduce

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

  :alt
  (+ x (/ y (/ (- z a) (- z t))))

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