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

Percentage Accurate: 85.4% → 98.0%
Time: 11.4s
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.4% 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.0% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 2: 76.7% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;t \leq 4.9 \cdot 10^{+35}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -7.50000000000000033e91 or 4.90000000000000025e35 < t

    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}{\frac{y}{\frac{a - t}{z - t}}} \]
    3. Simplified100.0%

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

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

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

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

    if -7.50000000000000033e91 < t < 3.9e-54

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

    if 3.9e-54 < t < 2.2e7

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if 2.2e7 < t < 4.90000000000000025e35

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{+91}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;t \leq 3.9 \cdot 10^{-54}:\\ \;\;\;\;x + z \cdot \frac{y}{a}\\ \mathbf{elif}\;t \leq 22000000:\\ \;\;\;\;\frac{z - t}{a - t} \cdot y\\ \mathbf{elif}\;t \leq 4.9 \cdot 10^{+35}:\\ \;\;\;\;x - \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{+118} \lor \neg \left(t \leq 6 \cdot 10^{+18}\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.05e+118) (not (<= t 6e+18)))
   (+ x y)
   (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.05e+118) || !(t <= 6e+18)) {
		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.05d+118)) .or. (.not. (t <= 6d+18))) 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.05e+118) || !(t <= 6e+18)) {
		tmp = x + y;
	} else {
		tmp = x + (z * (y / (a - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -1.05e+118) or not (t <= 6e+18):
		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.05e+118) || !(t <= 6e+18))
		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.05e+118) || ~((t <= 6e+18)))
		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.05e+118], N[Not[LessEqual[t, 6e+18]], $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.05 \cdot 10^{+118} \lor \neg \left(t \leq 6 \cdot 10^{+18}\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.05e118 or 6e18 < t

    1. Initial program 68.4%

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

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

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

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

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

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

    if -1.05e118 < t < 6e18

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

Alternative 4: 87.6% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.09999999999999993e118 or 4.25000000000000002e-19 < t

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

    if -1.09999999999999993e118 < t < 4.25000000000000002e-19

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

Alternative 5: 63.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+112}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -1.9 \cdot 10^{+77}:\\
\;\;\;\;y \cdot \frac{z}{a}\\

\mathbf{elif}\;a \leq 1.9 \cdot 10^{+118}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -9.5000000000000008e112 or 1.90000000000000008e118 < a

    1. Initial program 84.2%

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

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

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

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

    if -9.5000000000000008e112 < a < -1.9000000000000001e77

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000001e77 < a < 1.90000000000000008e118

    1. Initial program 87.7%

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

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

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

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

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

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

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

Alternative 6: 64.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.99999999999999986e219 or 2.10000000000000002e83 < z

    1. Initial program 91.7%

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999986e219 < z < 2.10000000000000002e83

    1. Initial program 85.7%

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

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

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

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

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

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

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

Alternative 7: 75.7% accurate, 0.6× speedup?

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

    1. Initial program 69.4%

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

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

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

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

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

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

    if -7.50000000000000033e91 < t < 3.8e18

    1. Initial program 97.5%

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

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

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

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

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

Alternative 8: 77.2% accurate, 0.6× speedup?

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

    1. Initial program 69.4%

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

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

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

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

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

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

    if -1.4499999999999999e93 < t < 3.9e18

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 60.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+138}:\\
\;\;\;\;x + y\\

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


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

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{-1 \cdot z}{t}} \]
      2. neg-mul-156.6%

        \[\leadsto y \cdot \frac{\color{blue}{-z}}{t} \]
    15. Simplified56.6%

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

    if -7.0000000000000002e219 < z < 2.8000000000000001e138

    1. Initial program 86.4%

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

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

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

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

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

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

    if 2.8000000000000001e138 < z

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    11. Step-by-step derivation
      1. *-commutative45.5%

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{a}} \]
    12. Applied egg-rr53.9%

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

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

Alternative 10: 63.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+25}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 10^{+118}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.00000000000000018e25 or 9.99999999999999967e117 < a

    1. Initial program 86.3%

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

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

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

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

    if -2.00000000000000018e25 < a < 9.99999999999999967e117

    1. Initial program 87.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+25}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 10^{+118}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 54.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 10^{+150}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.1999999999999996e100 or 9.99999999999999981e149 < y

    1. Initial program 67.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}{\frac{y}{\frac{a - t}{z - t}}} \]
    3. Simplified98.6%

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

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

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

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

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

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

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

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

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

    if -9.1999999999999996e100 < y < 9.99999999999999981e149

    1. Initial program 95.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{+100}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 10^{+150}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 60.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.5 \cdot 10^{+138}:\\
\;\;\;\;x + y\\

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


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

    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}{\frac{y}{\frac{a - t}{z - t}}} \]
    3. Simplified98.6%

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

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

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

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

    if 6.50000000000000054e138 < z

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z}{a}} \]
    11. Step-by-step derivation
      1. *-commutative45.5%

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

        \[\leadsto \color{blue}{\frac{z \cdot y}{a}} \]
    12. Applied egg-rr53.9%

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

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

Alternative 13: 51.7% 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 87.1%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification48.9%

    \[\leadsto x \]
  7. Add Preprocessing

Developer target: 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 2024019 
(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))))