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

Percentage Accurate: 85.1% → 96.0%
Time: 11.0s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 85.1% accurate, 1.0× speedup?

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

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

Alternative 1: 96.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

Alternative 2: 92.4% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 29.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 9.9999999999999996e297

    1. Initial program 99.8%

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

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

Alternative 3: 83.2% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.79999999999999996e94 or 1.12e33 < t

    1. Initial program 66.4%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified84.3%

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

    if -1.79999999999999996e94 < t < -1.65e-90

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65e-90 < t < -3.9999999999999999e-241

    1. Initial program 99.9%

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

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

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

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

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

    if -3.9999999999999999e-241 < t < 1.12e33

    1. Initial program 93.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+94}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq -1.65 \cdot 10^{-90}:\\ \;\;\;\;x + y \cdot \frac{z}{a - t}\\ \mathbf{elif}\;t \leq -4 \cdot 10^{-241}:\\ \;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\ \mathbf{elif}\;t \leq 1.12 \cdot 10^{+33}:\\ \;\;\;\;x + z \cdot \frac{y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 88.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6e20 or 185 < z

    1. Initial program 82.4%

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

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

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

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

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

    if -2.6e20 < z < 185

    1. Initial program 88.0%

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

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

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

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

        \[\leadsto \color{blue}{x - \frac{t}{a - t} \cdot y} \]
      4. *-commutative91.2%

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

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

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

Alternative 5: 84.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.5e94 or 4.19999999999999958e31 < t

    1. Initial program 66.4%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified84.3%

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

    if -1.5e94 < t < 4.19999999999999958e31

    1. Initial program 96.4%

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

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

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

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

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

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

Alternative 6: 62.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.8 \cdot 10^{-84}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-190}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-122}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= t -7.8e-84)
   (+ x y)
   (if (<= t 3.4e-190)
     x
     (if (<= t 4e-122) (/ y (/ a z)) (if (<= t 2.6e+23) x (+ x y))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (t <= -7.8e-84) {
		tmp = x + y;
	} else if (t <= 3.4e-190) {
		tmp = x;
	} else if (t <= 4e-122) {
		tmp = y / (a / z);
	} else if (t <= 2.6e+23) {
		tmp = x;
	} else {
		tmp = x + y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (t <= (-7.8d-84)) then
        tmp = x + y
    else if (t <= 3.4d-190) then
        tmp = x
    else if (t <= 4d-122) then
        tmp = y / (a / z)
    else if (t <= 2.6d+23) then
        tmp = x
    else
        tmp = x + y
    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.8e-84) {
		tmp = x + y;
	} else if (t <= 3.4e-190) {
		tmp = x;
	} else if (t <= 4e-122) {
		tmp = y / (a / z);
	} else if (t <= 2.6e+23) {
		tmp = x;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if t <= -7.8e-84:
		tmp = x + y
	elif t <= 3.4e-190:
		tmp = x
	elif t <= 4e-122:
		tmp = y / (a / z)
	elif t <= 2.6e+23:
		tmp = x
	else:
		tmp = x + y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (t <= -7.8e-84)
		tmp = Float64(x + y);
	elseif (t <= 3.4e-190)
		tmp = x;
	elseif (t <= 4e-122)
		tmp = Float64(y / Float64(a / z));
	elseif (t <= 2.6e+23)
		tmp = x;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (t <= -7.8e-84)
		tmp = x + y;
	elseif (t <= 3.4e-190)
		tmp = x;
	elseif (t <= 4e-122)
		tmp = y / (a / z);
	elseif (t <= 2.6e+23)
		tmp = x;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.8e-84], N[(x + y), $MachinePrecision], If[LessEqual[t, 3.4e-190], x, If[LessEqual[t, 4e-122], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+23], x, N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 3.4 \cdot 10^{-190}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.80000000000000045e-84 or 2.59999999999999992e23 < t

    1. Initial program 78.2%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified76.1%

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

    if -7.80000000000000045e-84 < t < 3.39999999999999981e-190 or 4.00000000000000024e-122 < t < 2.59999999999999992e23

    1. Initial program 96.3%

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

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

    if 3.39999999999999981e-190 < t < 4.00000000000000024e-122

    1. Initial program 79.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.8 \cdot 10^{-84}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-190}:\\ \;\;\;\;x\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-122}:\\ \;\;\;\;\frac{y}{\frac{a}{z}}\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 7: 65.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+129} \lor \neg \left(z \leq 2.1 \cdot 10^{+123}\right):\\
\;\;\;\;z \cdot \frac{y}{a - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.5000000000000004e129 or 2.09999999999999994e123 < z

    1. Initial program 80.8%

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

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

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

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

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

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

    if -9.5000000000000004e129 < z < 2.09999999999999994e123

    1. Initial program 87.4%

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

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

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

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

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

Alternative 8: 76.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+26} \lor \neg \left(t \leq 1.1 \cdot 10^{+31}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.19999999999999967e26 or 1.10000000000000005e31 < t

    1. Initial program 73.1%

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

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

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

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

    if -8.19999999999999967e26 < t < 1.10000000000000005e31

    1. Initial program 95.9%

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

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

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

Alternative 9: 77.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.1999999999999998e25 or 9.5000000000000008e31 < t

    1. Initial program 73.1%

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

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

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

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

    if -4.1999999999999998e25 < t < 9.5000000000000008e31

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 77.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.0999999999999999e27 or 1.9000000000000001e30 < t

    1. Initial program 73.1%

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

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

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

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

    if -1.0999999999999999e27 < t < 1.9000000000000001e30

    1. Initial program 95.9%

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

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

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

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

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

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

Alternative 11: 63.4% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+23}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.80000000000000045e-84 or 1.89999999999999987e23 < t

    1. Initial program 78.2%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified76.1%

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

    if -7.80000000000000045e-84 < t < 1.89999999999999987e23

    1. Initial program 94.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.8 \cdot 10^{-84}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 12: 52.2% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-251}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.2 \cdot 10^{-287}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.5000000000000002e-251 or 1.2e-287 < x

    1. Initial program 87.1%

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

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

    if -6.5000000000000002e-251 < x < 1.2e-287

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-251}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.2 \cdot 10^{-287}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 13: 50.9% 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 85.7%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification57.8%

    \[\leadsto x \]

Developer target: 98.4% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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