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

Percentage Accurate: 86.0% → 98.2%
Time: 11.4s
Alternatives: 16
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 16 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: 86.0% 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: 98.2% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 86.6%

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

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

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

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

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

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

    if 2e86 < z

    1. Initial program 75.3%

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

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

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

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

Alternative 2: 84.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+95} \lor \neg \left(t \leq 1.75 \cdot 10^{+69}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.05e95 or 1.74999999999999994e69 < t

    1. Initial program 73.3%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.8%

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

    if -1.05e95 < t < 1.74999999999999994e69

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

Alternative 3: 84.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+95} \lor \neg \left(t \leq 1.08 \cdot 10^{+74}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.75e95 or 1.08e74 < t

    1. Initial program 73.3%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.8%

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

    if -1.75e95 < t < 1.08e74

    1. Initial program 91.7%

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

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

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

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

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

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

Alternative 4: 84.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.0000000000000002e94 or 1.1000000000000001e74 < t

    1. Initial program 73.3%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.8%

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

    if -8.0000000000000002e94 < t < 1.1000000000000001e74

    1. Initial program 91.7%

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

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

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

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

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

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

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

Alternative 5: 87.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+94}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

        \[\leadsto x - y \cdot \color{blue}{\left(\frac{z}{t} - \frac{t}{t}\right)} \]
      5. sub-neg97.4%

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

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

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

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

    if -5.4999999999999997e94 < t < 5.8000000000000005e73

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

    if 5.8000000000000005e73 < t

    1. Initial program 76.4%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a - t} + x \]
      4. distribute-lft-neg-out71.4%

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

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

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

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

        \[\leadsto \color{blue}{y} \cdot \frac{-t}{a - t} + x \]
      9. distribute-neg-frac93.3%

        \[\leadsto y \cdot \color{blue}{\left(-\frac{t}{a - t}\right)} + x \]
      10. distribute-neg-frac293.3%

        \[\leadsto y \cdot \color{blue}{\frac{t}{-\left(a - t\right)}} + x \]
      11. neg-sub093.3%

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

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

        \[\leadsto y \cdot \frac{t}{0 - \color{blue}{\left(\left(-t\right) + a\right)}} + x \]
      14. associate--r+93.3%

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

        \[\leadsto y \cdot \frac{t}{\color{blue}{\left(-\left(-t\right)\right)} - a} + x \]
      16. remove-double-neg93.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t - a}{t}}} + x \]
    10. Step-by-step derivation
      1. div-sub93.4%

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

        \[\leadsto \frac{y}{\color{blue}{1} - \frac{a}{t}} + x \]
    11. Simplified93.4%

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

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

Alternative 6: 86.1% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified93.9%

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

    if -2.4e95 < t < 6.19999999999999992e67

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

    if 6.19999999999999992e67 < t

    1. Initial program 76.4%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a - t} + x \]
      4. distribute-lft-neg-out71.4%

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

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

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

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

        \[\leadsto \color{blue}{y} \cdot \frac{-t}{a - t} + x \]
      9. distribute-neg-frac93.3%

        \[\leadsto y \cdot \color{blue}{\left(-\frac{t}{a - t}\right)} + x \]
      10. distribute-neg-frac293.3%

        \[\leadsto y \cdot \color{blue}{\frac{t}{-\left(a - t\right)}} + x \]
      11. neg-sub093.3%

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

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

        \[\leadsto y \cdot \frac{t}{0 - \color{blue}{\left(\left(-t\right) + a\right)}} + x \]
      14. associate--r+93.3%

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

        \[\leadsto y \cdot \frac{t}{\color{blue}{\left(-\left(-t\right)\right)} - a} + x \]
      16. remove-double-neg93.3%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{t - a}{t}}} + x \]
    10. Step-by-step derivation
      1. div-sub93.4%

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

        \[\leadsto \frac{y}{\color{blue}{1} - \frac{a}{t}} + x \]
    11. Simplified93.4%

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

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

Alternative 7: 86.1% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified93.9%

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

    if -5.7000000000000002e94 < t < 3.3999999999999998e72

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

    if 3.3999999999999998e72 < t

    1. Initial program 76.4%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{a - t} + x \]
      4. distribute-lft-neg-out71.4%

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

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

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

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

        \[\leadsto \color{blue}{y} \cdot \frac{-t}{a - t} + x \]
      9. distribute-neg-frac93.3%

        \[\leadsto y \cdot \color{blue}{\left(-\frac{t}{a - t}\right)} + x \]
      10. distribute-neg-frac293.3%

        \[\leadsto y \cdot \color{blue}{\frac{t}{-\left(a - t\right)}} + x \]
      11. neg-sub093.3%

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

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

        \[\leadsto y \cdot \frac{t}{0 - \color{blue}{\left(\left(-t\right) + a\right)}} + x \]
      14. associate--r+93.3%

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

        \[\leadsto y \cdot \frac{t}{\color{blue}{\left(-\left(-t\right)\right)} - a} + x \]
      16. remove-double-neg93.3%

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

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

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

Alternative 8: 76.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+94} \lor \neg \left(t \leq 6.5 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.1999999999999998e94 or 6.4999999999999995e67 < t

    1. Initial program 73.3%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.8%

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

    if -5.1999999999999998e94 < t < 6.4999999999999995e67

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
    7. Simplified74.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    11. Simplified75.3%

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

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

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{a}{y}}} + x \]
      3. un-div-inv75.8%

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

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

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

Alternative 9: 76.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{+94} \lor \neg \left(t \leq 5.3 \cdot 10^{+67}\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 -5e+94) (not (<= t 5.3e+67))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -5e+94) || !(t <= 5.3e+67)) {
		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 <= (-5d+94)) .or. (.not. (t <= 5.3d+67))) 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 <= -5e+94) || !(t <= 5.3e+67)) {
		tmp = x + y;
	} else {
		tmp = x + (z * (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -5e+94) or not (t <= 5.3e+67):
		tmp = x + y
	else:
		tmp = x + (z * (y / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -5e+94) || !(t <= 5.3e+67))
		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 <= -5e+94) || ~((t <= 5.3e+67)))
		tmp = x + y;
	else
		tmp = x + (z * (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5e+94], N[Not[LessEqual[t, 5.3e+67]], $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 -5 \cdot 10^{+94} \lor \neg \left(t \leq 5.3 \cdot 10^{+67}\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 < -5.0000000000000001e94 or 5.3e67 < t

    1. Initial program 73.3%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.8%

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

    if -5.0000000000000001e94 < t < 5.3e67

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
    7. Simplified74.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{a} \cdot z} + x \]
    11. Simplified75.3%

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

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

Alternative 10: 76.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.25 \cdot 10^{+95} \lor \neg \left(t \leq 8 \cdot 10^{+70}\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 -2.25e+95) (not (<= t 8e+70))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -2.25e+95) || !(t <= 8e+70)) {
		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 <= (-2.25d+95)) .or. (.not. (t <= 8d+70))) 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 <= -2.25e+95) || !(t <= 8e+70)) {
		tmp = x + y;
	} else {
		tmp = x + (y * (z / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -2.25e+95) or not (t <= 8e+70):
		tmp = x + y
	else:
		tmp = x + (y * (z / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -2.25e+95) || !(t <= 8e+70))
		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 <= -2.25e+95) || ~((t <= 8e+70)))
		tmp = x + y;
	else
		tmp = x + (y * (z / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.25e+95], N[Not[LessEqual[t, 8e+70]], $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 -2.25 \cdot 10^{+95} \lor \neg \left(t \leq 8 \cdot 10^{+70}\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 < -2.25000000000000008e95 or 8.00000000000000058e70 < t

    1. Initial program 73.3%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified88.8%

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

    if -2.25000000000000008e95 < t < 8.00000000000000058e70

    1. Initial program 91.7%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{a}} + x \]
    7. Simplified74.2%

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

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

Alternative 11: 75.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{+94} \lor \neg \left(t \leq 5.5 \cdot 10^{+28}\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 -5e+94) (not (<= t 5.5e+28))) (+ x y) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -5e+94) || !(t <= 5.5e+28)) {
		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 <= (-5d+94)) .or. (.not. (t <= 5.5d+28))) 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 <= -5e+94) || !(t <= 5.5e+28)) {
		tmp = x + y;
	} else {
		tmp = x + ((z * y) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -5e+94) or not (t <= 5.5e+28):
		tmp = x + y
	else:
		tmp = x + ((z * y) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -5e+94) || !(t <= 5.5e+28))
		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 <= -5e+94) || ~((t <= 5.5e+28)))
		tmp = x + y;
	else
		tmp = x + ((z * y) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5e+94], N[Not[LessEqual[t, 5.5e+28]], $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 -5 \cdot 10^{+94} \lor \neg \left(t \leq 5.5 \cdot 10^{+28}\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 < -5.0000000000000001e94 or 5.5000000000000003e28 < t

    1. Initial program 72.7%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified85.2%

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

    if -5.0000000000000001e94 < t < 5.5000000000000003e28

    1. Initial program 93.1%

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

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

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

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

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

Alternative 12: 97.6% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 85.3%

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

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

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

    if 5.3000000000000001e160 < z

    1. Initial program 80.7%

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

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

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

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

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

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

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

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

Alternative 13: 52.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+104}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.80000000000000014e128 or 2.2e104 < y

    1. Initial program 56.9%

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

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

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

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified35.4%

      \[\leadsto \color{blue}{y + x} \]
    8. Taylor expanded in y around inf 31.8%

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

    if -1.80000000000000014e128 < y < 2.2e104

    1. Initial program 96.7%

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

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 95.9% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 15: 61.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.4 \cdot 10^{+130}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 8.39999999999999962e130

    1. Initial program 84.8%

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

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

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

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

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

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

    if 8.39999999999999962e130 < a

    1. Initial program 85.6%

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

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

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

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

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

Alternative 16: 51.4% accurate, 11.0× speedup?

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

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

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

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

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

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

Developer Target 1: 98.2% 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 2024139 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

  :alt
  (! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))

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