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

Percentage Accurate: 98.0% → 98.8%
Time: 12.5s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 98.0% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 52.7%

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

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

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

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

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

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

    if -inf.0 < (/.f64 (-.f64 z t) (-.f64 z a))

    1. Initial program 98.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

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

Alternative 2: 59.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t}{a}\\ \mathbf{if}\;t \leq -2.6 \cdot 10^{+272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+86}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 9.4 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+158}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+215} \lor \neg \left(t \leq 1.65 \cdot 10^{+220}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ t a))))
   (if (<= t -2.6e+272)
     t_1
     (if (<= t 1.15e+86)
       (+ x y)
       (if (<= t 9.4e+148)
         t_1
         (if (<= t 2.6e+158)
           (+ x y)
           (if (or (<= t 2.7e+215) (not (<= t 1.65e+220))) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double tmp;
	if (t <= -2.6e+272) {
		tmp = t_1;
	} else if (t <= 1.15e+86) {
		tmp = x + y;
	} else if (t <= 9.4e+148) {
		tmp = t_1;
	} else if (t <= 2.6e+158) {
		tmp = x + y;
	} else if ((t <= 2.7e+215) || !(t <= 1.65e+220)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = y * (t / a)
    if (t <= (-2.6d+272)) then
        tmp = t_1
    else if (t <= 1.15d+86) then
        tmp = x + y
    else if (t <= 9.4d+148) then
        tmp = t_1
    else if (t <= 2.6d+158) then
        tmp = x + y
    else if ((t <= 2.7d+215) .or. (.not. (t <= 1.65d+220))) then
        tmp = t_1
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * (t / a);
	double tmp;
	if (t <= -2.6e+272) {
		tmp = t_1;
	} else if (t <= 1.15e+86) {
		tmp = x + y;
	} else if (t <= 9.4e+148) {
		tmp = t_1;
	} else if (t <= 2.6e+158) {
		tmp = x + y;
	} else if ((t <= 2.7e+215) || !(t <= 1.65e+220)) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * (t / a)
	tmp = 0
	if t <= -2.6e+272:
		tmp = t_1
	elif t <= 1.15e+86:
		tmp = x + y
	elif t <= 9.4e+148:
		tmp = t_1
	elif t <= 2.6e+158:
		tmp = x + y
	elif (t <= 2.7e+215) or not (t <= 1.65e+220):
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(t / a))
	tmp = 0.0
	if (t <= -2.6e+272)
		tmp = t_1;
	elseif (t <= 1.15e+86)
		tmp = Float64(x + y);
	elseif (t <= 9.4e+148)
		tmp = t_1;
	elseif (t <= 2.6e+158)
		tmp = Float64(x + y);
	elseif ((t <= 2.7e+215) || !(t <= 1.65e+220))
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * (t / a);
	tmp = 0.0;
	if (t <= -2.6e+272)
		tmp = t_1;
	elseif (t <= 1.15e+86)
		tmp = x + y;
	elseif (t <= 9.4e+148)
		tmp = t_1;
	elseif (t <= 2.6e+158)
		tmp = x + y;
	elseif ((t <= 2.7e+215) || ~((t <= 1.65e+220)))
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+272], t$95$1, If[LessEqual[t, 1.15e+86], N[(x + y), $MachinePrecision], If[LessEqual[t, 9.4e+148], t$95$1, If[LessEqual[t, 2.6e+158], N[(x + y), $MachinePrecision], If[Or[LessEqual[t, 2.7e+215], N[Not[LessEqual[t, 1.65e+220]], $MachinePrecision]], t$95$1, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{t}{a}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+272}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.15 \cdot 10^{+86}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 9.4 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+158}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{+215} \lor \neg \left(t \leq 1.65 \cdot 10^{+220}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.59999999999999999e272 or 1.14999999999999995e86 < t < 9.3999999999999994e148 or 2.6e158 < t < 2.7e215 or 1.65000000000000011e220 < t

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - t \cdot \frac{\frac{y}{x}}{z - a}\right)} \]
    10. Taylor expanded in x around 0 66.2%

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

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

        \[\leadsto \frac{\color{blue}{\left(-1 \cdot t\right) \cdot y}}{z - a} \]
      3. neg-mul-166.2%

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot y}{a}} \]
    14. Step-by-step derivation
      1. *-commutative50.1%

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

        \[\leadsto \color{blue}{y \cdot \frac{t}{a}} \]
    15. Simplified61.5%

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

    if -2.59999999999999999e272 < t < 1.14999999999999995e86 or 9.3999999999999994e148 < t < 2.6e158

    1. Initial program 97.6%

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

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

    if 2.7e215 < t < 1.65000000000000011e220

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.6 \cdot 10^{+272}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+86}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 9.4 \cdot 10^{+148}:\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+158}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{+215} \lor \neg \left(t \leq 1.65 \cdot 10^{+220}\right):\\ \;\;\;\;y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{if}\;z \leq -1.5 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-23}:\\ \;\;\;\;x + \frac{y \cdot t}{a - z}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+156}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+234}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (- 1.0 (/ t z))))))
   (if (<= z -1.5e+91)
     t_1
     (if (<= z 7e-23)
       (+ x (/ (* y t) (- a z)))
       (if (<= z 8.5e+136)
         (- x (/ y (/ (- a z) z)))
         (if (<= z 1.6e+156)
           (+ x (* t (/ y a)))
           (if (<= z 5e+234) (+ x (* y (/ z (- z a)))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (1.0 - (t / z)));
	double tmp;
	if (z <= -1.5e+91) {
		tmp = t_1;
	} else if (z <= 7e-23) {
		tmp = x + ((y * t) / (a - z));
	} else if (z <= 8.5e+136) {
		tmp = x - (y / ((a - z) / z));
	} else if (z <= 1.6e+156) {
		tmp = x + (t * (y / a));
	} else if (z <= 5e+234) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (y * (1.0d0 - (t / z)))
    if (z <= (-1.5d+91)) then
        tmp = t_1
    else if (z <= 7d-23) then
        tmp = x + ((y * t) / (a - z))
    else if (z <= 8.5d+136) then
        tmp = x - (y / ((a - z) / z))
    else if (z <= 1.6d+156) then
        tmp = x + (t * (y / a))
    else if (z <= 5d+234) then
        tmp = x + (y * (z / (z - a)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (1.0 - (t / z)));
	double tmp;
	if (z <= -1.5e+91) {
		tmp = t_1;
	} else if (z <= 7e-23) {
		tmp = x + ((y * t) / (a - z));
	} else if (z <= 8.5e+136) {
		tmp = x - (y / ((a - z) / z));
	} else if (z <= 1.6e+156) {
		tmp = x + (t * (y / a));
	} else if (z <= 5e+234) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (1.0 - (t / z)))
	tmp = 0
	if z <= -1.5e+91:
		tmp = t_1
	elif z <= 7e-23:
		tmp = x + ((y * t) / (a - z))
	elif z <= 8.5e+136:
		tmp = x - (y / ((a - z) / z))
	elif z <= 1.6e+156:
		tmp = x + (t * (y / a))
	elif z <= 5e+234:
		tmp = x + (y * (z / (z - a)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z))))
	tmp = 0.0
	if (z <= -1.5e+91)
		tmp = t_1;
	elseif (z <= 7e-23)
		tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z)));
	elseif (z <= 8.5e+136)
		tmp = Float64(x - Float64(y / Float64(Float64(a - z) / z)));
	elseif (z <= 1.6e+156)
		tmp = Float64(x + Float64(t * Float64(y / a)));
	elseif (z <= 5e+234)
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (1.0 - (t / z)));
	tmp = 0.0;
	if (z <= -1.5e+91)
		tmp = t_1;
	elseif (z <= 7e-23)
		tmp = x + ((y * t) / (a - z));
	elseif (z <= 8.5e+136)
		tmp = x - (y / ((a - z) / z));
	elseif (z <= 1.6e+156)
		tmp = x + (t * (y / a));
	elseif (z <= 5e+234)
		tmp = x + (y * (z / (z - a)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+91], t$95$1, If[LessEqual[z, 7e-23], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+136], N[(x - N[(y / N[(N[(a - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+156], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+234], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+136}:\\
\;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\

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

\mathbf{elif}\;z \leq 5 \cdot 10^{+234}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.50000000000000003e91 or 5.0000000000000003e234 < z

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.50000000000000003e91 < z < 6.99999999999999987e-23

    1. Initial program 94.8%

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

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

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

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

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

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

    if 6.99999999999999987e-23 < z < 8.49999999999999966e136

    1. Initial program 99.9%

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

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

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

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

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

    if 8.49999999999999966e136 < z < 1.60000000000000001e156

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    5. Simplified100.0%

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

    if 1.60000000000000001e156 < z < 5.0000000000000003e234

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified95.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+91}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-23}:\\ \;\;\;\;x + \frac{y \cdot t}{a - z}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+136}:\\ \;\;\;\;x - \frac{y}{\frac{a - z}{z}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+156}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+234}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ \mathbf{if}\;z \leq -6.3 \cdot 10^{-18}:\\ \;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-186}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-195}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 10^{-252}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-55}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* t (/ y a)))))
   (if (<= z -6.3e-18)
     (+ x (/ y (- 1.0 (/ a z))))
     (if (<= z -2.9e-186)
       t_1
       (if (<= z -6.2e-195)
         (* t (/ y (- a z)))
         (if (<= z 1e-252)
           t_1
           (if (<= z 5.5e-55)
             (+ x (* y (/ t a)))
             (+ x (* y (/ z (- z a)))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double tmp;
	if (z <= -6.3e-18) {
		tmp = x + (y / (1.0 - (a / z)));
	} else if (z <= -2.9e-186) {
		tmp = t_1;
	} else if (z <= -6.2e-195) {
		tmp = t * (y / (a - z));
	} else if (z <= 1e-252) {
		tmp = t_1;
	} else if (z <= 5.5e-55) {
		tmp = x + (y * (t / a));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + (t * (y / a))
    if (z <= (-6.3d-18)) then
        tmp = x + (y / (1.0d0 - (a / z)))
    else if (z <= (-2.9d-186)) then
        tmp = t_1
    else if (z <= (-6.2d-195)) then
        tmp = t * (y / (a - z))
    else if (z <= 1d-252) then
        tmp = t_1
    else if (z <= 5.5d-55) then
        tmp = x + (y * (t / a))
    else
        tmp = x + (y * (z / (z - a)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double tmp;
	if (z <= -6.3e-18) {
		tmp = x + (y / (1.0 - (a / z)));
	} else if (z <= -2.9e-186) {
		tmp = t_1;
	} else if (z <= -6.2e-195) {
		tmp = t * (y / (a - z));
	} else if (z <= 1e-252) {
		tmp = t_1;
	} else if (z <= 5.5e-55) {
		tmp = x + (y * (t / a));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (t * (y / a))
	tmp = 0
	if z <= -6.3e-18:
		tmp = x + (y / (1.0 - (a / z)))
	elif z <= -2.9e-186:
		tmp = t_1
	elif z <= -6.2e-195:
		tmp = t * (y / (a - z))
	elif z <= 1e-252:
		tmp = t_1
	elif z <= 5.5e-55:
		tmp = x + (y * (t / a))
	else:
		tmp = x + (y * (z / (z - a)))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(t * Float64(y / a)))
	tmp = 0.0
	if (z <= -6.3e-18)
		tmp = Float64(x + Float64(y / Float64(1.0 - Float64(a / z))));
	elseif (z <= -2.9e-186)
		tmp = t_1;
	elseif (z <= -6.2e-195)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= 1e-252)
		tmp = t_1;
	elseif (z <= 5.5e-55)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	else
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (t * (y / a));
	tmp = 0.0;
	if (z <= -6.3e-18)
		tmp = x + (y / (1.0 - (a / z)));
	elseif (z <= -2.9e-186)
		tmp = t_1;
	elseif (z <= -6.2e-195)
		tmp = t * (y / (a - z));
	elseif (z <= 1e-252)
		tmp = t_1;
	elseif (z <= 5.5e-55)
		tmp = x + (y * (t / a));
	else
		tmp = x + (y * (z / (z - a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.3e-18], N[(x + N[(y / N[(1.0 - N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.9e-186], t$95$1, If[LessEqual[z, -6.2e-195], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-252], t$95$1, If[LessEqual[z, 5.5e-55], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-186}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6.2 \cdot 10^{-195}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\

\mathbf{elif}\;z \leq 10^{-252}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -6.3000000000000004e-18

    1. Initial program 99.8%

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

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

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z} - \frac{a}{z}}} \]
      2. *-inverses85.7%

        \[\leadsto x + \frac{y}{\color{blue}{1} - \frac{a}{z}} \]
    7. Simplified85.7%

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

    if -6.3000000000000004e-18 < z < -2.90000000000000019e-186 or -6.20000000000000005e-195 < z < 9.99999999999999943e-253

    1. Initial program 94.4%

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

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

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

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

    if -2.90000000000000019e-186 < z < -6.20000000000000005e-195

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-rgt-neg-in76.3%

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

        \[\leadsto \color{blue}{t \cdot \frac{-y}{z - a}} \]
    9. Simplified100.0%

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

    if 9.99999999999999943e-253 < z < 5.4999999999999999e-55

    1. Initial program 92.1%

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

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

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

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

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

    if 5.4999999999999999e-55 < z

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.3 \cdot 10^{-18}:\\ \;\;\;\;x + \frac{y}{1 - \frac{a}{z}}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-186}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-195}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 10^{-252}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-55}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 77.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\ t_2 := x + t \cdot \frac{y}{a}\\ \mathbf{if}\;a \leq -1.2 \cdot 10^{-45}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq 3 \cdot 10^{-166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-139}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* y (- 1.0 (/ t z))))) (t_2 (+ x (* t (/ y a)))))
   (if (<= a -1.2e-45)
     t_2
     (if (<= a 3e-166)
       t_1
       (if (<= a 4.5e-139)
         (* t (/ y (- a z)))
         (if (<= a 1.55e-53) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (1.0 - (t / z)));
	double t_2 = x + (t * (y / a));
	double tmp;
	if (a <= -1.2e-45) {
		tmp = t_2;
	} else if (a <= 3e-166) {
		tmp = t_1;
	} else if (a <= 4.5e-139) {
		tmp = t * (y / (a - z));
	} else if (a <= 1.55e-53) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x + (y * (1.0d0 - (t / z)))
    t_2 = x + (t * (y / a))
    if (a <= (-1.2d-45)) then
        tmp = t_2
    else if (a <= 3d-166) then
        tmp = t_1
    else if (a <= 4.5d-139) then
        tmp = t * (y / (a - z))
    else if (a <= 1.55d-53) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (y * (1.0 - (t / z)));
	double t_2 = x + (t * (y / a));
	double tmp;
	if (a <= -1.2e-45) {
		tmp = t_2;
	} else if (a <= 3e-166) {
		tmp = t_1;
	} else if (a <= 4.5e-139) {
		tmp = t * (y / (a - z));
	} else if (a <= 1.55e-53) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (y * (1.0 - (t / z)))
	t_2 = x + (t * (y / a))
	tmp = 0
	if a <= -1.2e-45:
		tmp = t_2
	elif a <= 3e-166:
		tmp = t_1
	elif a <= 4.5e-139:
		tmp = t * (y / (a - z))
	elif a <= 1.55e-53:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(y * Float64(1.0 - Float64(t / z))))
	t_2 = Float64(x + Float64(t * Float64(y / a)))
	tmp = 0.0
	if (a <= -1.2e-45)
		tmp = t_2;
	elseif (a <= 3e-166)
		tmp = t_1;
	elseif (a <= 4.5e-139)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (a <= 1.55e-53)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + (y * (1.0 - (t / z)));
	t_2 = x + (t * (y / a));
	tmp = 0.0;
	if (a <= -1.2e-45)
		tmp = t_2;
	elseif (a <= 3e-166)
		tmp = t_1;
	elseif (a <= 4.5e-139)
		tmp = t * (y / (a - z));
	elseif (a <= 1.55e-53)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.2e-45], t$95$2, If[LessEqual[a, 3e-166], t$95$1, If[LessEqual[a, 4.5e-139], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.55e-53], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + y \cdot \left(1 - \frac{t}{z}\right)\\
t_2 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;a \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq 3 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-139}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\

\mathbf{elif}\;a \leq 1.55 \cdot 10^{-53}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.19999999999999995e-45 or 1.55000000000000008e-53 < a

    1. Initial program 99.2%

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

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

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

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

    if -1.19999999999999995e-45 < a < 3.0000000000000003e-166 or 4.50000000000000023e-139 < a < 1.55000000000000008e-53

    1. Initial program 95.8%

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

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

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

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

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

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

    if 3.0000000000000003e-166 < a < 4.50000000000000023e-139

    1. Initial program 42.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z - a} \]
      3. distribute-rgt-neg-in99.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{-45}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 3 \cdot 10^{-166}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-139}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{-53}:\\ \;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

    if -1.89999999999999983e153 < z < 2.9000000000000001e-44

    1. Initial program 95.0%

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

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

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

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

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

    if 2.9000000000000001e-44 < z

    1. Initial program 100.0%

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

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

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

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

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

Alternative 7: 74.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.89999999999999983e153 or 5.0000000000000002e-55 < z

    1. Initial program 99.9%

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

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

    if -1.89999999999999983e153 < z < 5.0000000000000002e-55

    1. Initial program 94.9%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    5. Simplified78.1%

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

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

Alternative 8: 98.2% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 9: 59.9% accurate, 3.7× speedup?

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

\\
x + y
\end{array}
Derivation
  1. Initial program 96.9%

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

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

Alternative 10: 50.4% 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 96.9%

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

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

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

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

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

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

Developer target: 98.2% 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 2024107 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
  :precision binary64

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

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