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

Percentage Accurate: 97.9% → 95.8%
Time: 12.9s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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: 97.9% accurate, 1.0× speedup?

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

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

Alternative 1: 95.8% accurate, 1.0× speedup?

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

\\
x + \frac{y}{a - t} \cdot \left(z - t\right)
\end{array}
Derivation
  1. Initial program 97.6%

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

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

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
    2. associate-/r/98.3%

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

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

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

Alternative 2: 82.9% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot t\_1\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\

\mathbf{elif}\;t\_1 \leq 10^{+49}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 9.99999999999999946e48 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 93.5%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      2. associate-/r/96.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{a - t} - \frac{t}{a - t}\right)} \]
    12. Step-by-step derivation
      1. div-sub73.1%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a - t}} \]
    13. Simplified73.1%

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

    if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 9.99999999999999946e48

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.3%

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

Alternative 3: 87.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{z - t}{a - t}\\
t_2 := y \cdot t\_1\\
\mathbf{if}\;t\_1 \leq -500:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;t\_1 \leq 10^{+49}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 9.99999999999999946e48 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 93.5%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      2. associate-/r/96.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{z}{a - t} - \frac{t}{a - t}\right)} \]
    12. Step-by-step derivation
      1. div-sub73.1%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{a - t}} \]
    13. Simplified73.1%

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

    if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      2. associate-/r/98.8%

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

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

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

    if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 9.99999999999999946e48

    1. Initial program 100.0%

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

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

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

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

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

Alternative 4: 96.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\

\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 94.1%

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

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

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

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

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

    if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      2. associate-/r/98.8%

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

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

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

    if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999

    1. Initial program 100.0%

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

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

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

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.6%

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

Alternative 5: 97.0% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 94.1%

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

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

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

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

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

    if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999

    1. Initial program 100.0%

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

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

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

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

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

Alternative 6: 97.2% accurate, 0.3× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 94.1%

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

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

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

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

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

    if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.9999999999999999e-7

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if 1.9999999999999999e-7 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}} \]
      2. associate-/r/99.5%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{y}{1} \cdot \frac{z - t}{t}} \]
      5. /-rgt-identity99.1%

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

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

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

Alternative 7: 95.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\

\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x - t \cdot \frac{y}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 94.1%

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

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

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

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

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

    if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999996e-12

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if 1.99999999999999996e-12 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{a - t}} \]
      3. *-commutative67.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a - t}{t}}} \]
    5. Simplified99.1%

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

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

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

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

Alternative 8: 97.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-12}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\

\mathbf{elif}\;t\_1 \leq 1.005:\\
\;\;\;\;x - \frac{y}{\frac{a - t}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 z t) (-.f64 a t)) < -500 or 1.0049999999999999 < (/.f64 (-.f64 z t) (-.f64 a t))

    1. Initial program 94.1%

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

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

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

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

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

    if -500 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.99999999999999996e-12

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if 1.99999999999999996e-12 < (/.f64 (-.f64 z t) (-.f64 a t)) < 1.0049999999999999

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{a - t}} \]
      3. *-commutative67.0%

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a - t}{t}}} \]
    5. Simplified99.1%

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

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

Alternative 9: 76.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - y \cdot \frac{z}{t}\\ \mathbf{if}\;t \leq -1 \cdot 10^{+187}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -2 \cdot 10^{+42}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-14}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq -5.7 \cdot 10^{-68}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 1850\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* y (/ z t)))))
   (if (<= t -1e+187)
     (+ x y)
     (if (<= t -2e+42)
       t_1
       (if (<= t -1.35e-14)
         (+ x (* z (/ y a)))
         (if (<= t -5.7e-68)
           t_1
           (if (or (<= t -7.5e-83) (not (<= t 1850.0)))
             (+ x y)
             (+ x (/ z (/ a y))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * (z / t));
	double tmp;
	if (t <= -1e+187) {
		tmp = x + y;
	} else if (t <= -2e+42) {
		tmp = t_1;
	} else if (t <= -1.35e-14) {
		tmp = x + (z * (y / a));
	} else if (t <= -5.7e-68) {
		tmp = t_1;
	} else if ((t <= -7.5e-83) || !(t <= 1850.0)) {
		tmp = x + y;
	} else {
		tmp = x + (z / (a / y));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x - (y * (z / t))
    if (t <= (-1d+187)) then
        tmp = x + y
    else if (t <= (-2d+42)) then
        tmp = t_1
    else if (t <= (-1.35d-14)) then
        tmp = x + (z * (y / a))
    else if (t <= (-5.7d-68)) then
        tmp = t_1
    else if ((t <= (-7.5d-83)) .or. (.not. (t <= 1850.0d0))) then
        tmp = x + y
    else
        tmp = x + (z / (a / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (y * (z / t));
	double tmp;
	if (t <= -1e+187) {
		tmp = x + y;
	} else if (t <= -2e+42) {
		tmp = t_1;
	} else if (t <= -1.35e-14) {
		tmp = x + (z * (y / a));
	} else if (t <= -5.7e-68) {
		tmp = t_1;
	} else if ((t <= -7.5e-83) || !(t <= 1850.0)) {
		tmp = x + y;
	} else {
		tmp = x + (z / (a / y));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (y * (z / t))
	tmp = 0
	if t <= -1e+187:
		tmp = x + y
	elif t <= -2e+42:
		tmp = t_1
	elif t <= -1.35e-14:
		tmp = x + (z * (y / a))
	elif t <= -5.7e-68:
		tmp = t_1
	elif (t <= -7.5e-83) or not (t <= 1850.0):
		tmp = x + y
	else:
		tmp = x + (z / (a / y))
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(y * Float64(z / t)))
	tmp = 0.0
	if (t <= -1e+187)
		tmp = Float64(x + y);
	elseif (t <= -2e+42)
		tmp = t_1;
	elseif (t <= -1.35e-14)
		tmp = Float64(x + Float64(z * Float64(y / a)));
	elseif (t <= -5.7e-68)
		tmp = t_1;
	elseif ((t <= -7.5e-83) || !(t <= 1850.0))
		tmp = Float64(x + y);
	else
		tmp = Float64(x + Float64(z / Float64(a / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (y * (z / t));
	tmp = 0.0;
	if (t <= -1e+187)
		tmp = x + y;
	elseif (t <= -2e+42)
		tmp = t_1;
	elseif (t <= -1.35e-14)
		tmp = x + (z * (y / a));
	elseif (t <= -5.7e-68)
		tmp = t_1;
	elseif ((t <= -7.5e-83) || ~((t <= 1850.0)))
		tmp = x + y;
	else
		tmp = x + (z / (a / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e+187], N[(x + y), $MachinePrecision], If[LessEqual[t, -2e+42], t$95$1, If[LessEqual[t, -1.35e-14], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.7e-68], t$95$1, If[Or[LessEqual[t, -7.5e-83], N[Not[LessEqual[t, 1850.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;t \leq -5.7 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 1850\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -9.99999999999999907e186 or -5.7000000000000002e-68 < t < -7.4999999999999997e-83 or 1850 < t

    1. Initial program 100.0%

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

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

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

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

    if -9.99999999999999907e186 < t < -2.00000000000000009e42 or -1.3499999999999999e-14 < t < -5.7000000000000002e-68

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{y \cdot z}{t}} \]
      3. *-lft-identity76.9%

        \[\leadsto x - \frac{y \cdot z}{\color{blue}{1 \cdot t}} \]
      4. times-frac79.9%

        \[\leadsto x - \color{blue}{\frac{y}{1} \cdot \frac{z}{t}} \]
      5. /-rgt-identity79.9%

        \[\leadsto x - \color{blue}{y} \cdot \frac{z}{t} \]
    6. Simplified79.9%

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

    if -2.00000000000000009e42 < t < -1.3499999999999999e-14

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    7. Applied egg-rr76.3%

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

    if -7.4999999999999997e-83 < t < 1850

    1. Initial program 95.2%

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

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

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{1 \cdot a}} + x \]
      3. times-frac81.9%

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{z}{a}} + x \]
      4. /-rgt-identity81.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{\frac{a}{y}}} + x \]
    7. Applied egg-rr84.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+187}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -2 \cdot 10^{+42}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq -1.35 \cdot 10^{-14}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq -5.7 \cdot 10^{-68}:\\ \;\;\;\;x - y \cdot \frac{z}{t}\\ \mathbf{elif}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 1850\right):\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x + \frac{z}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 75.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-83} \lor \neg \left(t \leq 0.028\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.4999999999999997e-83 or 0.0280000000000000006 < t

    1. Initial program 99.9%

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

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

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

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

    if -7.4999999999999997e-83 < t < 0.0280000000000000006

    1. Initial program 95.2%

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

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

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

Alternative 11: 76.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.034 \lor \neg \left(t \leq 2400\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.034000000000000002 or 2400 < t

    1. Initial program 100.0%

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

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

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

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

    if -0.034000000000000002 < t < 2400

    1. Initial program 95.8%

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

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

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

        \[\leadsto \frac{y \cdot z}{\color{blue}{1 \cdot a}} + x \]
      3. times-frac79.4%

        \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{z}{a}} + x \]
      4. /-rgt-identity79.4%

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

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

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

Alternative 12: 76.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.049 \lor \neg \left(t \leq 28.5\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.049000000000000002 or 28.5 < t

    1. Initial program 100.0%

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

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

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

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

    if -0.049000000000000002 < t < 28.5

    1. Initial program 95.8%

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

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{a}{z}}} + x \]
    5. Simplified79.4%

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    7. Applied egg-rr81.4%

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

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

Alternative 13: 62.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.95 \cdot 10^{-88} \lor \neg \left(t \leq 3 \cdot 10^{+110}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.94999999999999996e-88 or 3.00000000000000007e110 < t

    1. Initial program 99.9%

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

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

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

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

    if -1.94999999999999996e-88 < t < 3.00000000000000007e110

    1. Initial program 95.6%

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

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

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

Alternative 14: 97.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 15: 50.2% accurate, 11.0× speedup?

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

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

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification49.7%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 99.2% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

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