Rosa's DopplerBench

Percentage Accurate: 73.0% → 98.0%
Time: 10.8s
Alternatives: 14
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\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 14 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: 73.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1):
	return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 / (t1 + u)) * (v / (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.4%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. distribute-frac-neg98.4%

      \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
    3. distribute-neg-frac298.4%

      \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    4. +-commutative98.4%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    5. distribute-neg-in98.4%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    6. unsub-neg98.4%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified98.4%

    \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Final simplification98.4%

    \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \]
  6. Add Preprocessing

Alternative 2: 89.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -2.35 \cdot 10^{+98} \lor \neg \left(t1 \leq 9 \cdot 10^{+188}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -2.35e+98) (not (<= t1 9e+188)))
   (/ v (- u t1))
   (* t1 (/ (/ v (+ t1 u)) (- (- u) t1)))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.35e+98) || !(t1 <= 9e+188)) {
		tmp = v / (u - t1);
	} else {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-2.35d+98)) .or. (.not. (t1 <= 9d+188))) then
        tmp = v / (u - t1)
    else
        tmp = t1 * ((v / (t1 + u)) / (-u - t1))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -2.35e+98) || !(t1 <= 9e+188)) {
		tmp = v / (u - t1);
	} else {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -2.35e+98) or not (t1 <= 9e+188):
		tmp = v / (u - t1)
	else:
		tmp = t1 * ((v / (t1 + u)) / (-u - t1))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -2.35e+98) || !(t1 <= 9e+188))
		tmp = Float64(v / Float64(u - t1));
	else
		tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -2.35e+98) || ~((t1 <= 9e+188)))
		tmp = v / (u - t1);
	else
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -2.35e+98], N[Not[LessEqual[t1, 9e+188]], $MachinePrecision]], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -2.35 \cdot 10^{+98} \lor \neg \left(t1 \leq 9 \cdot 10^{+188}\right):\\
\;\;\;\;\frac{v}{u - t1}\\

\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -2.34999999999999985e98 or 9.00000000000000021e188 < t1

    1. Initial program 38.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg100.0%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac2100.0%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative100.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 90.8%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times38.8%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt17.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod38.8%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg38.8%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod21.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt38.8%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr38.8%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in v around 0 90.9%

      \[\leadsto \color{blue}{\frac{v}{u - t1}} \]

    if -2.34999999999999985e98 < t1 < 9.00000000000000021e188

    1. Initial program 80.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.6%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified79.6%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/r*90.2%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u}}{t1 + u}} \]
      2. div-inv90.1%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\left(\frac{v}{t1 + u} \cdot \frac{1}{t1 + u}\right)} \]
    6. Applied egg-rr90.1%

      \[\leadsto \left(-t1\right) \cdot \color{blue}{\left(\frac{v}{t1 + u} \cdot \frac{1}{t1 + u}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/90.2%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u} \cdot 1}{t1 + u}} \]
      2. *-rgt-identity90.2%

        \[\leadsto \left(-t1\right) \cdot \frac{\color{blue}{\frac{v}{t1 + u}}}{t1 + u} \]
    8. Simplified90.2%

      \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u}}{t1 + u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -2.35 \cdot 10^{+98} \lor \neg \left(t1 \leq 9 \cdot 10^{+188}\right):\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 87.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.06 \cdot 10^{+129}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 6 \cdot 10^{+47}:\\ \;\;\;\;\left(-v\right) \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -1.06e+129)
   (/ v (- u t1))
   (if (<= t1 6e+47)
     (* (- v) (/ t1 (* (+ t1 u) (+ t1 u))))
     (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.06e+129) {
		tmp = v / (u - t1);
	} else if (t1 <= 6e+47) {
		tmp = -v * (t1 / ((t1 + u) * (t1 + u)));
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-1.06d+129)) then
        tmp = v / (u - t1)
    else if (t1 <= 6d+47) then
        tmp = -v * (t1 / ((t1 + u) * (t1 + u)))
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.06e+129) {
		tmp = v / (u - t1);
	} else if (t1 <= 6e+47) {
		tmp = -v * (t1 / ((t1 + u) * (t1 + u)));
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -1.06e+129:
		tmp = v / (u - t1)
	elif t1 <= 6e+47:
		tmp = -v * (t1 / ((t1 + u) * (t1 + u)))
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -1.06e+129)
		tmp = Float64(v / Float64(u - t1));
	elseif (t1 <= 6e+47)
		tmp = Float64(Float64(-v) * Float64(t1 / Float64(Float64(t1 + u) * Float64(t1 + u))));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -1.06e+129)
		tmp = v / (u - t1);
	elseif (t1 <= 6e+47)
		tmp = -v * (t1 / ((t1 + u) * (t1 + u)));
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -1.06e+129], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6e+47], N[((-v) * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.06 \cdot 10^{+129}:\\
\;\;\;\;\frac{v}{u - t1}\\

\mathbf{elif}\;t1 \leq 6 \cdot 10^{+47}:\\
\;\;\;\;\left(-v\right) \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.06e129

    1. Initial program 32.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac100.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg100.0%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac2100.0%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative100.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg100.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 85.7%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times32.2%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt10.7%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod32.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg32.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod21.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt32.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr32.2%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in v around 0 85.9%

      \[\leadsto \color{blue}{\frac{v}{u - t1}} \]

    if -1.06e129 < t1 < 6.0000000000000003e47

    1. Initial program 84.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/88.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative88.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified88.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing

    if 6.0000000000000003e47 < t1

    1. Initial program 45.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/50.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative50.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified50.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/45.6%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative45.6%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod13.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg13.7%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod32.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt32.7%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg32.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative32.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod50.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg50.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod89.2%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt40.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod82.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg82.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 88.5%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. neg-mul-188.5%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified88.5%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.06 \cdot 10^{+129}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 6 \cdot 10^{+47}:\\ \;\;\;\;\left(-v\right) \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -5.8 \cdot 10^{+99} \lor \neg \left(u \leq 1.15 \cdot 10^{+31}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u - t1}}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -5.8e+99) (not (<= u 1.15e+31)))
   (/ (* t1 (/ v u)) (- t1 u))
   (/ (* v (/ t1 (- u t1))) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -5.8e+99) || !(u <= 1.15e+31)) {
		tmp = (t1 * (v / u)) / (t1 - u);
	} else {
		tmp = (v * (t1 / (u - t1))) / t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-5.8d+99)) .or. (.not. (u <= 1.15d+31))) then
        tmp = (t1 * (v / u)) / (t1 - u)
    else
        tmp = (v * (t1 / (u - t1))) / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -5.8e+99) || !(u <= 1.15e+31)) {
		tmp = (t1 * (v / u)) / (t1 - u);
	} else {
		tmp = (v * (t1 / (u - t1))) / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -5.8e+99) or not (u <= 1.15e+31):
		tmp = (t1 * (v / u)) / (t1 - u)
	else:
		tmp = (v * (t1 / (u - t1))) / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -5.8e+99) || !(u <= 1.15e+31))
		tmp = Float64(Float64(t1 * Float64(v / u)) / Float64(t1 - u));
	else
		tmp = Float64(Float64(v * Float64(t1 / Float64(u - t1))) / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -5.8e+99) || ~((u <= 1.15e+31)))
		tmp = (t1 * (v / u)) / (t1 - u);
	else
		tmp = (v * (t1 / (u - t1))) / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5.8e+99], N[Not[LessEqual[u, 1.15e+31]], $MachinePrecision]], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / N[(t1 - u), $MachinePrecision]), $MachinePrecision], N[(N[(v * N[(t1 / N[(u - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.8 \cdot 10^{+99} \lor \neg \left(u \leq 1.15 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u - t1}}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.8000000000000004e99 or 1.15e31 < u

    1. Initial program 75.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg97.4%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac297.4%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative97.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in97.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg97.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified97.4%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 88.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/88.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg88.0%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified88.0%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Step-by-step derivation
      1. clear-num88.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-t1}}} \cdot \frac{v}{t1 + u} \]
      2. frac-2neg88.0%

        \[\leadsto \frac{1}{\frac{u}{-t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      3. frac-times77.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      4. *-un-lft-identity77.7%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      5. add-sqr-sqrt34.9%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. sqrt-unprod62.1%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. sqr-neg62.1%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      8. sqrt-unprod39.2%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      9. add-sqr-sqrt67.5%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      10. add-sqr-sqrt35.0%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      11. sqrt-unprod61.1%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      12. sqr-neg61.1%

        \[\leadsto \frac{v}{\frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. sqrt-unprod37.8%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      14. add-sqr-sqrt77.7%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot \left(-\left(t1 + u\right)\right)} \]
      15. distribute-neg-in77.7%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      16. add-sqr-sqrt39.9%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      17. sqrt-unprod74.5%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      18. sqr-neg74.5%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod37.8%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      20. add-sqr-sqrt77.9%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      21. sub-neg77.9%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \color{blue}{\left(t1 - u\right)}} \]
    9. Applied egg-rr77.9%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{t1} \cdot \left(t1 - u\right)}} \]
    10. Step-by-step derivation
      1. associate-/r*88.1%

        \[\leadsto \color{blue}{\frac{\frac{v}{\frac{u}{t1}}}{t1 - u}} \]
    11. Simplified88.1%

      \[\leadsto \color{blue}{\frac{\frac{v}{\frac{u}{t1}}}{t1 - u}} \]
    12. Step-by-step derivation
      1. associate-/r/90.6%

        \[\leadsto \frac{\color{blue}{\frac{v}{u} \cdot t1}}{t1 - u} \]
    13. Applied egg-rr90.6%

      \[\leadsto \frac{\color{blue}{\frac{v}{u} \cdot t1}}{t1 - u} \]

    if -5.8000000000000004e99 < u < 1.15e31

    1. Initial program 64.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.2%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.2%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.2%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.2%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.2%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 74.3%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/79.2%

        \[\leadsto \color{blue}{\frac{\frac{t1}{\left(-u\right) - t1} \cdot v}{t1}} \]
      2. add-sqr-sqrt38.0%

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1} \cdot v}{t1} \]
      3. sqrt-unprod79.9%

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1} \cdot v}{t1} \]
      4. sqr-neg79.9%

        \[\leadsto \frac{\frac{t1}{\sqrt{\color{blue}{u \cdot u}} - t1} \cdot v}{t1} \]
      5. sqrt-unprod41.0%

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1} \cdot v}{t1} \]
      6. add-sqr-sqrt80.0%

        \[\leadsto \frac{\frac{t1}{\color{blue}{u} - t1} \cdot v}{t1} \]
    7. Applied egg-rr80.0%

      \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification84.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5.8 \cdot 10^{+99} \lor \neg \left(u \leq 1.15 \cdot 10^{+31}\right):\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t1 - u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u - t1}}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.3 \cdot 10^{+183}:\\ \;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{-u}\\ \mathbf{elif}\;u \leq 5 \cdot 10^{+31}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u - t1}}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{v}{-u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -3.3e+183)
   (/ (/ v (/ u t1)) (- u))
   (if (<= u 5e+31) (/ (* v (/ t1 (- u t1))) t1) (* (/ t1 u) (/ v (- u))))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -3.3e+183) {
		tmp = (v / (u / t1)) / -u;
	} else if (u <= 5e+31) {
		tmp = (v * (t1 / (u - t1))) / t1;
	} else {
		tmp = (t1 / u) * (v / -u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-3.3d+183)) then
        tmp = (v / (u / t1)) / -u
    else if (u <= 5d+31) then
        tmp = (v * (t1 / (u - t1))) / t1
    else
        tmp = (t1 / u) * (v / -u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -3.3e+183) {
		tmp = (v / (u / t1)) / -u;
	} else if (u <= 5e+31) {
		tmp = (v * (t1 / (u - t1))) / t1;
	} else {
		tmp = (t1 / u) * (v / -u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -3.3e+183:
		tmp = (v / (u / t1)) / -u
	elif u <= 5e+31:
		tmp = (v * (t1 / (u - t1))) / t1
	else:
		tmp = (t1 / u) * (v / -u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -3.3e+183)
		tmp = Float64(Float64(v / Float64(u / t1)) / Float64(-u));
	elseif (u <= 5e+31)
		tmp = Float64(Float64(v * Float64(t1 / Float64(u - t1))) / t1);
	else
		tmp = Float64(Float64(t1 / u) * Float64(v / Float64(-u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -3.3e+183)
		tmp = (v / (u / t1)) / -u;
	elseif (u <= 5e+31)
		tmp = (v * (t1 / (u - t1))) / t1;
	else
		tmp = (t1 / u) * (v / -u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -3.3e+183], N[(N[(v / N[(u / t1), $MachinePrecision]), $MachinePrecision] / (-u)), $MachinePrecision], If[LessEqual[u, 5e+31], N[(N[(v * N[(t1 / N[(u - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision], N[(N[(t1 / u), $MachinePrecision] * N[(v / (-u)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.3 \cdot 10^{+183}:\\
\;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{-u}\\

\mathbf{elif}\;u \leq 5 \cdot 10^{+31}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u - t1}}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{-u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -3.3000000000000001e183

    1. Initial program 84.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.8%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.8%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.8%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 99.8%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg99.8%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified99.8%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-t1}}} \cdot \frac{v}{t1 + u} \]
      2. frac-2neg99.8%

        \[\leadsto \frac{1}{\frac{u}{-t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      3. frac-times90.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      4. *-un-lft-identity90.6%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      5. add-sqr-sqrt26.7%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. sqrt-unprod70.1%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. sqr-neg70.1%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      8. sqrt-unprod60.4%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      9. add-sqr-sqrt84.1%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      10. add-sqr-sqrt51.0%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      11. sqrt-unprod70.7%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      12. sqr-neg70.7%

        \[\leadsto \frac{v}{\frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. sqrt-unprod33.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      14. add-sqr-sqrt90.6%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot \left(-\left(t1 + u\right)\right)} \]
      15. distribute-neg-in90.6%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      16. add-sqr-sqrt57.1%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      17. sqrt-unprod84.3%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      18. sqr-neg84.3%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod33.5%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      20. add-sqr-sqrt90.6%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      21. sub-neg90.6%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \color{blue}{\left(t1 - u\right)}} \]
    9. Applied egg-rr90.6%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{t1} \cdot \left(t1 - u\right)}} \]
    10. Step-by-step derivation
      1. associate-/r*99.9%

        \[\leadsto \color{blue}{\frac{\frac{v}{\frac{u}{t1}}}{t1 - u}} \]
    11. Simplified99.9%

      \[\leadsto \color{blue}{\frac{\frac{v}{\frac{u}{t1}}}{t1 - u}} \]
    12. Taylor expanded in t1 around 0 99.9%

      \[\leadsto \frac{\frac{v}{\frac{u}{t1}}}{\color{blue}{-1 \cdot u}} \]
    13. Step-by-step derivation
      1. neg-mul-199.9%

        \[\leadsto \frac{\frac{v}{\frac{u}{t1}}}{\color{blue}{-u}} \]
    14. Simplified99.9%

      \[\leadsto \frac{\frac{v}{\frac{u}{t1}}}{\color{blue}{-u}} \]

    if -3.3000000000000001e183 < u < 5.00000000000000027e31

    1. Initial program 65.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.1%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.1%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.1%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.1%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.1%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 72.4%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/78.7%

        \[\leadsto \color{blue}{\frac{\frac{t1}{\left(-u\right) - t1} \cdot v}{t1}} \]
      2. add-sqr-sqrt41.5%

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1} \cdot v}{t1} \]
      3. sqrt-unprod78.6%

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1} \cdot v}{t1} \]
      4. sqr-neg78.6%

        \[\leadsto \frac{\frac{t1}{\sqrt{\color{blue}{u \cdot u}} - t1} \cdot v}{t1} \]
      5. sqrt-unprod37.1%

        \[\leadsto \frac{\frac{t1}{\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1} \cdot v}{t1} \]
      6. add-sqr-sqrt79.5%

        \[\leadsto \frac{\frac{t1}{\color{blue}{u} - t1} \cdot v}{t1} \]
    7. Applied egg-rr79.5%

      \[\leadsto \color{blue}{\frac{\frac{t1}{u - t1} \cdot v}{t1}} \]

    if 5.00000000000000027e31 < u

    1. Initial program 71.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.4%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.4%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.4%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.4%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.4%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.4%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 85.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/85.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg85.7%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 84.5%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.3 \cdot 10^{+183}:\\ \;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{-u}\\ \mathbf{elif}\;u \leq 5 \cdot 10^{+31}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u - t1}}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{v}{-u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -0.00031:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 0.0042:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{v}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -0.00031)
   (/ v (- u t1))
   (if (<= t1 0.0042) (* (/ t1 u) (/ v (- u))) (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -0.00031) {
		tmp = v / (u - t1);
	} else if (t1 <= 0.0042) {
		tmp = (t1 / u) * (v / -u);
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-0.00031d0)) then
        tmp = v / (u - t1)
    else if (t1 <= 0.0042d0) then
        tmp = (t1 / u) * (v / -u)
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -0.00031) {
		tmp = v / (u - t1);
	} else if (t1 <= 0.0042) {
		tmp = (t1 / u) * (v / -u);
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -0.00031:
		tmp = v / (u - t1)
	elif t1 <= 0.0042:
		tmp = (t1 / u) * (v / -u)
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -0.00031)
		tmp = Float64(v / Float64(u - t1));
	elseif (t1 <= 0.0042)
		tmp = Float64(Float64(t1 / u) * Float64(v / Float64(-u)));
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -0.00031)
		tmp = v / (u - t1);
	elseif (t1 <= 0.0042)
		tmp = (t1 / u) * (v / -u);
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -0.00031], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 0.0042], N[(N[(t1 / u), $MachinePrecision] * N[(v / (-u)), $MachinePrecision]), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -0.00031:\\
\;\;\;\;\frac{v}{u - t1}\\

\mathbf{elif}\;t1 \leq 0.0042:\\
\;\;\;\;\frac{t1}{u} \cdot \frac{v}{-u}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -3.1e-4

    1. Initial program 58.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 80.3%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative80.3%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times54.3%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt20.8%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod55.9%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg55.9%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod33.5%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt54.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr54.2%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in v around 0 80.4%

      \[\leadsto \color{blue}{\frac{v}{u - t1}} \]

    if -3.1e-4 < t1 < 0.00419999999999999974

    1. Initial program 82.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac96.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg96.8%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac296.8%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative96.8%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in96.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg96.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified96.8%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 78.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/78.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg78.0%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified78.0%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Taylor expanded in t1 around 0 80.7%

      \[\leadsto \frac{-t1}{u} \cdot \color{blue}{\frac{v}{u}} \]

    if 0.00419999999999999974 < t1

    1. Initial program 54.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/58.3%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative58.3%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified58.3%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/54.3%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative54.3%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/99.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod18.2%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg18.2%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod33.6%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt33.6%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg33.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative33.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod58.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg58.1%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod89.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt38.3%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod84.4%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg84.4%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 87.7%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. neg-mul-187.7%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified87.7%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -0.00031:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 0.0042:\\ \;\;\;\;\frac{t1}{u} \cdot \frac{v}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.22 \cdot 10^{-147}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 9.2 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -1.22e-147)
   (/ v (- u t1))
   (if (<= t1 9.2e-106) (/ (/ v (/ u t1)) t1) (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.22e-147) {
		tmp = v / (u - t1);
	} else if (t1 <= 9.2e-106) {
		tmp = (v / (u / t1)) / t1;
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-1.22d-147)) then
        tmp = v / (u - t1)
    else if (t1 <= 9.2d-106) then
        tmp = (v / (u / t1)) / t1
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.22e-147) {
		tmp = v / (u - t1);
	} else if (t1 <= 9.2e-106) {
		tmp = (v / (u / t1)) / t1;
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -1.22e-147:
		tmp = v / (u - t1)
	elif t1 <= 9.2e-106:
		tmp = (v / (u / t1)) / t1
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -1.22e-147)
		tmp = Float64(v / Float64(u - t1));
	elseif (t1 <= 9.2e-106)
		tmp = Float64(Float64(v / Float64(u / t1)) / t1);
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -1.22e-147)
		tmp = v / (u - t1);
	elseif (t1 <= 9.2e-106)
		tmp = (v / (u / t1)) / t1;
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -1.22e-147], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 9.2e-106], N[(N[(v / N[(u / t1), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.22 \cdot 10^{-147}:\\
\;\;\;\;\frac{v}{u - t1}\\

\mathbf{elif}\;t1 \leq 9.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{\frac{v}{\frac{u}{t1}}}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.21999999999999995e-147

    1. Initial program 68.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 76.2%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative76.2%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times57.1%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt25.1%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod61.4%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg61.4%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod32.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt57.1%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr57.1%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in v around 0 75.3%

      \[\leadsto \color{blue}{\frac{v}{u - t1}} \]

    if -1.21999999999999995e-147 < t1 < 9.2000000000000004e-106

    1. Initial program 79.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.2%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg95.2%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac295.2%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative95.2%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in95.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg95.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified95.2%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 85.7%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/85.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg85.7%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
    8. Step-by-step derivation
      1. clear-num85.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{u}{-t1}}} \cdot \frac{v}{t1 + u} \]
      2. frac-2neg85.8%

        \[\leadsto \frac{1}{\frac{u}{-t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      3. frac-times85.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      4. *-un-lft-identity85.8%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      5. add-sqr-sqrt38.7%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      6. sqrt-unprod54.1%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      7. sqr-neg54.1%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      8. sqrt-unprod33.3%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      9. add-sqr-sqrt55.7%

        \[\leadsto \frac{\color{blue}{v}}{\frac{u}{-t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      10. add-sqr-sqrt22.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      11. sqrt-unprod54.9%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      12. sqr-neg54.9%

        \[\leadsto \frac{v}{\frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. sqrt-unprod51.5%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}} \cdot \left(-\left(t1 + u\right)\right)} \]
      14. add-sqr-sqrt85.8%

        \[\leadsto \frac{v}{\frac{u}{\color{blue}{t1}} \cdot \left(-\left(t1 + u\right)\right)} \]
      15. distribute-neg-in85.8%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \color{blue}{\left(\left(-t1\right) + \left(-u\right)\right)}} \]
      16. add-sqr-sqrt34.1%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)\right)} \]
      17. sqrt-unprod88.3%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)\right)} \]
      18. sqr-neg88.3%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)\right)} \]
      19. sqrt-unprod50.6%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)\right)} \]
      20. add-sqr-sqrt84.4%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \left(\color{blue}{t1} + \left(-u\right)\right)} \]
      21. sub-neg84.4%

        \[\leadsto \frac{v}{\frac{u}{t1} \cdot \color{blue}{\left(t1 - u\right)}} \]
    9. Applied egg-rr84.4%

      \[\leadsto \color{blue}{\frac{v}{\frac{u}{t1} \cdot \left(t1 - u\right)}} \]
    10. Step-by-step derivation
      1. associate-/r*82.7%

        \[\leadsto \color{blue}{\frac{\frac{v}{\frac{u}{t1}}}{t1 - u}} \]
    11. Simplified82.7%

      \[\leadsto \color{blue}{\frac{\frac{v}{\frac{u}{t1}}}{t1 - u}} \]
    12. Taylor expanded in t1 around inf 57.7%

      \[\leadsto \frac{\frac{v}{\frac{u}{t1}}}{\color{blue}{t1}} \]

    if 9.2000000000000004e-106 < t1

    1. Initial program 59.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/63.3%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative63.3%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified63.3%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/59.0%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative59.0%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/98.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod20.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg20.0%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod32.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt32.7%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg32.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative32.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod59.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg59.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod85.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt37.4%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod82.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg82.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr98.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 79.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. neg-mul-179.8%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified79.8%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 65.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -5 \cdot 10^{-148}:\\ \;\;\;\;\frac{v}{u - t1}\\ \mathbf{elif}\;t1 \leq 1.55 \cdot 10^{-103}:\\ \;\;\;\;\frac{v \cdot \frac{t1}{u}}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -5e-148)
   (/ v (- u t1))
   (if (<= t1 1.55e-103) (/ (* v (/ t1 u)) t1) (/ (- v) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -5e-148) {
		tmp = v / (u - t1);
	} else if (t1 <= 1.55e-103) {
		tmp = (v * (t1 / u)) / t1;
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-5d-148)) then
        tmp = v / (u - t1)
    else if (t1 <= 1.55d-103) then
        tmp = (v * (t1 / u)) / t1
    else
        tmp = -v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -5e-148) {
		tmp = v / (u - t1);
	} else if (t1 <= 1.55e-103) {
		tmp = (v * (t1 / u)) / t1;
	} else {
		tmp = -v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -5e-148:
		tmp = v / (u - t1)
	elif t1 <= 1.55e-103:
		tmp = (v * (t1 / u)) / t1
	else:
		tmp = -v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -5e-148)
		tmp = Float64(v / Float64(u - t1));
	elseif (t1 <= 1.55e-103)
		tmp = Float64(Float64(v * Float64(t1 / u)) / t1);
	else
		tmp = Float64(Float64(-v) / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -5e-148)
		tmp = v / (u - t1);
	elseif (t1 <= 1.55e-103)
		tmp = (v * (t1 / u)) / t1;
	else
		tmp = -v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -5e-148], N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 1.55e-103], N[(N[(v * N[(t1 / u), $MachinePrecision]), $MachinePrecision] / t1), $MachinePrecision], N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -5 \cdot 10^{-148}:\\
\;\;\;\;\frac{v}{u - t1}\\

\mathbf{elif}\;t1 \leq 1.55 \cdot 10^{-103}:\\
\;\;\;\;\frac{v \cdot \frac{t1}{u}}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{-v}{t1 + u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -4.9999999999999999e-148

    1. Initial program 68.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 76.2%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative76.2%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times57.1%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt25.1%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod61.4%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg61.4%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod32.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt57.1%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr57.1%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in v around 0 75.3%

      \[\leadsto \color{blue}{\frac{v}{u - t1}} \]

    if -4.9999999999999999e-148 < t1 < 1.5500000000000001e-103

    1. Initial program 79.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.2%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg95.2%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac295.2%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative95.2%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in95.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg95.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified95.2%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 30.8%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Taylor expanded in t1 around 0 23.9%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1} \]
    7. Step-by-step derivation
      1. associate-*r/85.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg85.7%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    8. Simplified23.9%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1} \]
    9. Step-by-step derivation
      1. *-commutative23.9%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{-t1}{u}} \]
      2. associate-*l/55.0%

        \[\leadsto \color{blue}{\frac{v \cdot \frac{-t1}{u}}{t1}} \]
      3. add-sqr-sqrt22.8%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{u}}{t1} \]
      4. sqrt-unprod52.6%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{u}}{t1} \]
      5. sqr-neg52.6%

        \[\leadsto \frac{v \cdot \frac{\sqrt{\color{blue}{t1 \cdot t1}}}{u}}{t1} \]
      6. sqrt-unprod32.7%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{u}}{t1} \]
      7. add-sqr-sqrt55.3%

        \[\leadsto \frac{v \cdot \frac{\color{blue}{t1}}{u}}{t1} \]
    10. Applied egg-rr55.3%

      \[\leadsto \color{blue}{\frac{v \cdot \frac{t1}{u}}{t1}} \]

    if 1.5500000000000001e-103 < t1

    1. Initial program 59.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/63.3%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative63.3%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified63.3%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/59.0%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative59.0%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      5. +-commutative99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      6. distribute-neg-in99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      7. sub-neg99.9%

        \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      8. associate-*r/98.9%

        \[\leadsto \color{blue}{\frac{\frac{-t1}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
      9. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      10. sqrt-unprod20.0%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      11. sqr-neg20.0%

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{t1 \cdot t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      12. sqrt-unprod32.7%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      13. add-sqr-sqrt32.7%

        \[\leadsto \frac{\frac{\color{blue}{t1}}{t1 + u} \cdot \left(-v\right)}{\left(-u\right) - t1} \]
      14. sub-neg32.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      15. +-commutative32.7%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\left(-t1\right) + \left(-u\right)}} \]
      16. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}} + \left(-u\right)} \]
      17. sqrt-unprod59.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)} \]
      18. sqr-neg59.8%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{\color{blue}{t1 \cdot t1}} + \left(-u\right)} \]
      19. sqrt-unprod85.5%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)} \]
      20. add-sqr-sqrt37.4%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{-u} \cdot \sqrt{-u}}} \]
      21. sqrt-unprod82.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}}} \]
      22. sqr-neg82.6%

        \[\leadsto \frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{\sqrt{t1} \cdot \sqrt{t1} + \sqrt{\color{blue}{u \cdot u}}} \]
    6. Applied egg-rr98.9%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 79.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. neg-mul-179.8%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified79.8%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 57.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.65 \cdot 10^{+101}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 1.06 \cdot 10^{+134}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{u}{v}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.65e+101)
   (/ v u)
   (if (<= u 1.06e+134) (/ v (- t1)) (/ 1.0 (/ u v)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.65e+101) {
		tmp = v / u;
	} else if (u <= 1.06e+134) {
		tmp = v / -t1;
	} else {
		tmp = 1.0 / (u / v);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-1.65d+101)) then
        tmp = v / u
    else if (u <= 1.06d+134) then
        tmp = v / -t1
    else
        tmp = 1.0d0 / (u / v)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.65e+101) {
		tmp = v / u;
	} else if (u <= 1.06e+134) {
		tmp = v / -t1;
	} else {
		tmp = 1.0 / (u / v);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.65e+101:
		tmp = v / u
	elif u <= 1.06e+134:
		tmp = v / -t1
	else:
		tmp = 1.0 / (u / v)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.65e+101)
		tmp = Float64(v / u);
	elseif (u <= 1.06e+134)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(1.0 / Float64(u / v));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.65e+101)
		tmp = v / u;
	elseif (u <= 1.06e+134)
		tmp = v / -t1;
	else
		tmp = 1.0 / (u / v);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.65e+101], N[(v / u), $MachinePrecision], If[LessEqual[u, 1.06e+134], N[(v / (-t1)), $MachinePrecision], N[(1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.65 \cdot 10^{+101}:\\
\;\;\;\;\frac{v}{u}\\

\mathbf{elif}\;u \leq 1.06 \cdot 10^{+134}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{u}{v}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.65000000000000006e101

    1. Initial program 82.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.7%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg95.7%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac295.7%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative95.7%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in95.7%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg95.7%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified95.7%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 48.6%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative48.6%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times42.6%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt42.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod71.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg71.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod0.0%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt42.7%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr42.7%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in t1 around 0 34.7%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -1.65000000000000006e101 < u < 1.05999999999999999e134

    1. Initial program 65.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/71.6%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative71.6%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified71.6%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 70.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/70.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-170.2%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified70.2%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 1.05999999999999999e134 < u

    1. Initial program 68.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 50.3%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Taylor expanded in t1 around 0 44.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1} \]
    7. Step-by-step derivation
      1. associate-*r/93.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg93.8%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    8. Simplified44.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1} \]
    9. Step-by-step derivation
      1. *-commutative44.1%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{-t1}{u}} \]
      2. clear-num44.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{t1}{v}}} \cdot \frac{-t1}{u} \]
      3. clear-num44.1%

        \[\leadsto \frac{1}{\frac{t1}{v}} \cdot \color{blue}{\frac{1}{\frac{u}{-t1}}} \]
      4. frac-times44.8%

        \[\leadsto \color{blue}{\frac{1 \cdot 1}{\frac{t1}{v} \cdot \frac{u}{-t1}}} \]
      5. metadata-eval44.8%

        \[\leadsto \frac{\color{blue}{1}}{\frac{t1}{v} \cdot \frac{u}{-t1}} \]
      6. add-sqr-sqrt21.8%

        \[\leadsto \frac{1}{\frac{t1}{v} \cdot \frac{u}{\color{blue}{\sqrt{-t1} \cdot \sqrt{-t1}}}} \]
      7. sqrt-unprod35.5%

        \[\leadsto \frac{1}{\frac{t1}{v} \cdot \frac{u}{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}} \]
      8. sqr-neg35.5%

        \[\leadsto \frac{1}{\frac{t1}{v} \cdot \frac{u}{\sqrt{\color{blue}{t1 \cdot t1}}}} \]
      9. sqrt-unprod22.3%

        \[\leadsto \frac{1}{\frac{t1}{v} \cdot \frac{u}{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}}}} \]
      10. add-sqr-sqrt44.5%

        \[\leadsto \frac{1}{\frac{t1}{v} \cdot \frac{u}{\color{blue}{t1}}} \]
    10. Applied egg-rr44.5%

      \[\leadsto \color{blue}{\frac{1}{\frac{t1}{v} \cdot \frac{u}{t1}}} \]
    11. Step-by-step derivation
      1. times-frac38.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{t1 \cdot u}{v \cdot t1}}} \]
      2. *-commutative38.3%

        \[\leadsto \frac{1}{\frac{t1 \cdot u}{\color{blue}{t1 \cdot v}}} \]
      3. times-frac37.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{t1}{t1} \cdot \frac{u}{v}}} \]
      4. *-inverses37.0%

        \[\leadsto \frac{1}{\color{blue}{1} \cdot \frac{u}{v}} \]
      5. *-lft-identity37.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{u}{v}}} \]
    12. Simplified37.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{u}{v}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.65 \cdot 10^{+101}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 1.06 \cdot 10^{+134}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{u}{v}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 57.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.25 \cdot 10^{+101} \lor \neg \left(u \leq 2.15 \cdot 10^{+201}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.25e+101) (not (<= u 2.15e+201))) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.25e+101) || !(u <= 2.15e+201)) {
		tmp = v / u;
	} else {
		tmp = v / -t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-2.25d+101)) .or. (.not. (u <= 2.15d+201))) then
        tmp = v / u
    else
        tmp = v / -t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.25e+101) || !(u <= 2.15e+201)) {
		tmp = v / u;
	} else {
		tmp = v / -t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.25e+101) or not (u <= 2.15e+201):
		tmp = v / u
	else:
		tmp = v / -t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.25e+101) || !(u <= 2.15e+201))
		tmp = Float64(v / u);
	else
		tmp = Float64(v / Float64(-t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.25e+101) || ~((u <= 2.15e+201)))
		tmp = v / u;
	else
		tmp = v / -t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.25e+101], N[Not[LessEqual[u, 2.15e+201]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.25 \cdot 10^{+101} \lor \neg \left(u \leq 2.15 \cdot 10^{+201}\right):\\
\;\;\;\;\frac{v}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{-t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.2500000000000001e101 or 2.14999999999999995e201 < u

    1. Initial program 79.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac97.3%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg97.3%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac297.3%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative97.3%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg97.3%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified97.3%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 49.1%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative49.1%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times45.2%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt26.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod72.5%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg72.5%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod18.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt45.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr45.2%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in t1 around 0 39.3%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -2.2500000000000001e101 < u < 2.14999999999999995e201

    1. Initial program 65.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/70.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative70.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified70.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 65.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/65.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-165.0%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified65.0%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.25 \cdot 10^{+101} \lor \neg \left(u \leq 2.15 \cdot 10^{+201}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 57.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.25 \cdot 10^{+101}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 2.45 \cdot 10^{+200}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -2.25e+101) (/ v u) (if (<= u 2.45e+200) (/ v (- t1)) (/ v (- u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.25e+101) {
		tmp = v / u;
	} else if (u <= 2.45e+200) {
		tmp = v / -t1;
	} else {
		tmp = v / -u;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-2.25d+101)) then
        tmp = v / u
    else if (u <= 2.45d+200) then
        tmp = v / -t1
    else
        tmp = v / -u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.25e+101) {
		tmp = v / u;
	} else if (u <= 2.45e+200) {
		tmp = v / -t1;
	} else {
		tmp = v / -u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -2.25e+101:
		tmp = v / u
	elif u <= 2.45e+200:
		tmp = v / -t1
	else:
		tmp = v / -u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -2.25e+101)
		tmp = Float64(v / u);
	elseif (u <= 2.45e+200)
		tmp = Float64(v / Float64(-t1));
	else
		tmp = Float64(v / Float64(-u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -2.25e+101)
		tmp = v / u;
	elseif (u <= 2.45e+200)
		tmp = v / -t1;
	else
		tmp = v / -u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -2.25e+101], N[(v / u), $MachinePrecision], If[LessEqual[u, 2.45e+200], N[(v / (-t1)), $MachinePrecision], N[(v / (-u)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.25 \cdot 10^{+101}:\\
\;\;\;\;\frac{v}{u}\\

\mathbf{elif}\;u \leq 2.45 \cdot 10^{+200}:\\
\;\;\;\;\frac{v}{-t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{-u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -2.2500000000000001e101

    1. Initial program 82.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac95.7%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg95.7%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac295.7%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative95.7%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in95.7%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg95.7%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified95.7%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 48.6%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative48.6%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times42.6%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt42.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod71.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg71.2%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod0.0%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt42.7%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr42.7%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in t1 around 0 34.7%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -2.2500000000000001e101 < u < 2.44999999999999991e200

    1. Initial program 65.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/70.5%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative70.5%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified70.5%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 65.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/65.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-165.0%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified65.0%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 2.44999999999999991e200 < u

    1. Initial program 74.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.8%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.8%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.8%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 50.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Taylor expanded in t1 around 0 46.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. associate-*r/46.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \]
      2. neg-mul-146.9%

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified46.9%

      \[\leadsto \color{blue}{\frac{-v}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.25 \cdot 10^{+101}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 2.45 \cdot 10^{+200}:\\ \;\;\;\;\frac{v}{-t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 20.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq 8 \cdot 10^{+102}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1) :precision binary64 (if (<= t1 8e+102) (/ v u) (/ v t1)))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= 8e+102) {
		tmp = v / u;
	} else {
		tmp = v / t1;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= 8d+102) then
        tmp = v / u
    else
        tmp = v / t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= 8e+102) {
		tmp = v / u;
	} else {
		tmp = v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= 8e+102:
		tmp = v / u
	else:
		tmp = v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= 8e+102)
		tmp = Float64(v / u);
	else
		tmp = Float64(v / t1);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= 8e+102)
		tmp = v / u;
	else
		tmp = v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, 8e+102], N[(v / u), $MachinePrecision], N[(v / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq 8 \cdot 10^{+102}:\\
\;\;\;\;\frac{v}{u}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < 7.99999999999999982e102

    1. Initial program 76.0%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.0%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.0%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.0%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 57.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
    6. Step-by-step derivation
      1. *-commutative57.0%

        \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
      2. frac-times46.8%

        \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
      3. add-sqr-sqrt18.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
      4. sqrt-unprod59.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
      5. sqr-neg59.6%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
      6. sqrt-unprod28.1%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
      7. add-sqr-sqrt47.3%

        \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
    7. Applied egg-rr47.3%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
    8. Taylor expanded in t1 around 0 19.2%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if 7.99999999999999982e102 < t1

    1. Initial program 38.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/42.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative42.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified42.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 86.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/86.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-186.0%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified86.0%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt25.8%

        \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1} \]
      2. sqrt-unprod33.2%

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1} \]
      3. sqr-neg33.2%

        \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{t1} \]
      4. sqrt-unprod17.9%

        \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1} \]
      5. add-sqr-sqrt29.1%

        \[\leadsto \frac{\color{blue}{v}}{t1} \]
      6. div-inv29.1%

        \[\leadsto \color{blue}{v \cdot \frac{1}{t1}} \]
    9. Applied egg-rr29.1%

      \[\leadsto \color{blue}{v \cdot \frac{1}{t1}} \]
    10. Step-by-step derivation
      1. associate-*r/29.1%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{t1}} \]
      2. *-rgt-identity29.1%

        \[\leadsto \frac{\color{blue}{v}}{t1} \]
    11. Simplified29.1%

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

Alternative 13: 60.8% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \frac{v}{u - t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v (- u t1)))
double code(double u, double v, double t1) {
	return v / (u - t1);
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v / (u - t1)
end function
public static double code(double u, double v, double t1) {
	return v / (u - t1);
}
def code(u, v, t1):
	return v / (u - t1)
function code(u, v, t1)
	return Float64(v / Float64(u - t1))
end
function tmp = code(u, v, t1)
	tmp = v / (u - t1);
end
code[u_, v_, t1_] := N[(v / N[(u - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{u - t1}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.4%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. distribute-frac-neg98.4%

      \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
    3. distribute-neg-frac298.4%

      \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    4. +-commutative98.4%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    5. distribute-neg-in98.4%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    6. unsub-neg98.4%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified98.4%

    \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 62.7%

    \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{v}{t1}} \]
  6. Step-by-step derivation
    1. *-commutative62.7%

      \[\leadsto \color{blue}{\frac{v}{t1} \cdot \frac{t1}{\left(-u\right) - t1}} \]
    2. frac-times45.2%

      \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(\left(-u\right) - t1\right)}} \]
    3. add-sqr-sqrt18.6%

      \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{-u} \cdot \sqrt{-u}} - t1\right)} \]
    4. sqrt-unprod55.7%

      \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{\left(-u\right) \cdot \left(-u\right)}} - t1\right)} \]
    5. sqr-neg55.7%

      \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\sqrt{\color{blue}{u \cdot u}} - t1\right)} \]
    6. sqrt-unprod26.6%

      \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{\sqrt{u} \cdot \sqrt{u}} - t1\right)} \]
    7. add-sqr-sqrt45.7%

      \[\leadsto \frac{v \cdot t1}{t1 \cdot \left(\color{blue}{u} - t1\right)} \]
  7. Applied egg-rr45.7%

    \[\leadsto \color{blue}{\frac{v \cdot t1}{t1 \cdot \left(u - t1\right)}} \]
  8. Taylor expanded in v around 0 60.1%

    \[\leadsto \color{blue}{\frac{v}{u - t1}} \]
  9. Add Preprocessing

Alternative 14: 13.8% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \frac{v}{t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
	return v / t1;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v / t1
end function
public static double code(double u, double v, double t1) {
	return v / t1;
}
def code(u, v, t1):
	return v / t1
function code(u, v, t1)
	return Float64(v / t1)
end
function tmp = code(u, v, t1)
	tmp = v / t1;
end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{t1}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/72.7%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. *-commutative72.7%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  3. Simplified72.7%

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 51.1%

    \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
  6. Step-by-step derivation
    1. associate-*r/51.1%

      \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
    2. neg-mul-151.1%

      \[\leadsto \frac{\color{blue}{-v}}{t1} \]
  7. Simplified51.1%

    \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  8. Step-by-step derivation
    1. add-sqr-sqrt21.7%

      \[\leadsto \frac{\color{blue}{\sqrt{-v} \cdot \sqrt{-v}}}{t1} \]
    2. sqrt-unprod28.6%

      \[\leadsto \frac{\color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}}}{t1} \]
    3. sqr-neg28.6%

      \[\leadsto \frac{\sqrt{\color{blue}{v \cdot v}}}{t1} \]
    4. sqrt-unprod6.3%

      \[\leadsto \frac{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}{t1} \]
    5. add-sqr-sqrt12.8%

      \[\leadsto \frac{\color{blue}{v}}{t1} \]
    6. div-inv12.8%

      \[\leadsto \color{blue}{v \cdot \frac{1}{t1}} \]
  9. Applied egg-rr12.8%

    \[\leadsto \color{blue}{v \cdot \frac{1}{t1}} \]
  10. Step-by-step derivation
    1. associate-*r/12.8%

      \[\leadsto \color{blue}{\frac{v \cdot 1}{t1}} \]
    2. *-rgt-identity12.8%

      \[\leadsto \frac{\color{blue}{v}}{t1} \]
  11. Simplified12.8%

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024186 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))