Rosa's DopplerBench

Percentage Accurate: 73.5% → 97.9%
Time: 12.3s
Alternatives: 19
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 19 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.5% 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: 97.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (/ (/ (* t1 (/ v (+ t1 u))) -1.0) (+ t1 u)))
double code(double u, double v, double t1) {
	return ((t1 * (v / (t1 + u))) / -1.0) / (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))) / (-1.0d0)) / (t1 + u)
end function
public static double code(double u, double v, double t1) {
	return ((t1 * (v / (t1 + u))) / -1.0) / (t1 + u);
}
def code(u, v, t1):
	return ((t1 * (v / (t1 + u))) / -1.0) / (t1 + u)
function code(u, v, t1)
	return Float64(Float64(Float64(t1 * Float64(v / Float64(t1 + u))) / -1.0) / Float64(t1 + u))
end
function tmp = code(u, v, t1)
	tmp = ((t1 * (v / (t1 + u))) / -1.0) / (t1 + u);
end
code[u_, v_, t1_] := N[(N[(N[(t1 * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / -1.0), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
  7. Final simplification99.5%

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

Alternative 2: 74.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -0.082 \lor \neg \left(t1 \leq -1.52 \cdot 10^{-74} \lor \neg \left(t1 \leq -1.1 \cdot 10^{-103}\right) \land t1 \leq 6.6 \cdot 10^{-161}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{v}{u \cdot \left(\left(-u\right) - t1\right)}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -0.082)
         (not
          (or (<= t1 -1.52e-74)
              (and (not (<= t1 -1.1e-103)) (<= t1 6.6e-161)))))
   (/ v (- (- t1) (* u 2.0)))
   (* t1 (/ v (* u (- (- u) t1))))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -0.082) || !((t1 <= -1.52e-74) || (!(t1 <= -1.1e-103) && (t1 <= 6.6e-161)))) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = t1 * (v / (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 <= (-0.082d0)) .or. (.not. (t1 <= (-1.52d-74)) .or. (.not. (t1 <= (-1.1d-103))) .and. (t1 <= 6.6d-161))) then
        tmp = v / (-t1 - (u * 2.0d0))
    else
        tmp = t1 * (v / (u * (-u - t1)))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -0.082) || !((t1 <= -1.52e-74) || (!(t1 <= -1.1e-103) && (t1 <= 6.6e-161)))) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = t1 * (v / (u * (-u - t1)));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -0.082) or not ((t1 <= -1.52e-74) or (not (t1 <= -1.1e-103) and (t1 <= 6.6e-161))):
		tmp = v / (-t1 - (u * 2.0))
	else:
		tmp = t1 * (v / (u * (-u - t1)))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -0.082) || !((t1 <= -1.52e-74) || (!(t1 <= -1.1e-103) && (t1 <= 6.6e-161))))
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	else
		tmp = Float64(t1 * Float64(v / Float64(u * Float64(Float64(-u) - t1))));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -0.082) || ~(((t1 <= -1.52e-74) || (~((t1 <= -1.1e-103)) && (t1 <= 6.6e-161)))))
		tmp = v / (-t1 - (u * 2.0));
	else
		tmp = t1 * (v / (u * (-u - t1)));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -0.082], N[Not[Or[LessEqual[t1, -1.52e-74], And[N[Not[LessEqual[t1, -1.1e-103]], $MachinePrecision], LessEqual[t1, 6.6e-161]]]], $MachinePrecision]], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(v / N[(u * N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -0.082 \lor \neg \left(t1 \leq -1.52 \cdot 10^{-74} \lor \neg \left(t1 \leq -1.1 \cdot 10^{-103}\right) \land t1 \leq 6.6 \cdot 10^{-161}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -0.0820000000000000034 or -1.51999999999999997e-74 < t1 < -1.1e-103 or 6.5999999999999997e-161 < t1

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative83.4%

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

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

    if -0.0820000000000000034 < t1 < -1.51999999999999997e-74 or -1.1e-103 < t1 < 6.5999999999999997e-161

    1. Initial program 74.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -0.082 \lor \neg \left(t1 \leq -1.52 \cdot 10^{-74} \lor \neg \left(t1 \leq -1.1 \cdot 10^{-103}\right) \land t1 \leq 6.6 \cdot 10^{-161}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{v}{u \cdot \left(\left(-u\right) - t1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 75.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{if}\;t1 \leq -0.16:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq -1.65 \cdot 10^{-73}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{-u}}{t1 + u}\\ \mathbf{elif}\;t1 \leq -1.1 \cdot 10^{-103} \lor \neg \left(t1 \leq 6.6 \cdot 10^{-161}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{\left(-u\right) - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ v (- (- t1) (* u 2.0)))))
   (if (<= t1 -0.16)
     t_1
     (if (<= t1 -1.65e-73)
       (* t1 (/ (/ v (- u)) (+ t1 u)))
       (if (or (<= t1 -1.1e-103) (not (<= t1 6.6e-161)))
         t_1
         (* v (/ (/ t1 u) (- (- u) t1))))))))
double code(double u, double v, double t1) {
	double t_1 = v / (-t1 - (u * 2.0));
	double tmp;
	if (t1 <= -0.16) {
		tmp = t_1;
	} else if (t1 <= -1.65e-73) {
		tmp = t1 * ((v / -u) / (t1 + u));
	} else if ((t1 <= -1.1e-103) || !(t1 <= 6.6e-161)) {
		tmp = t_1;
	} else {
		tmp = 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) :: t_1
    real(8) :: tmp
    t_1 = v / (-t1 - (u * 2.0d0))
    if (t1 <= (-0.16d0)) then
        tmp = t_1
    else if (t1 <= (-1.65d-73)) then
        tmp = t1 * ((v / -u) / (t1 + u))
    else if ((t1 <= (-1.1d-103)) .or. (.not. (t1 <= 6.6d-161))) then
        tmp = t_1
    else
        tmp = v * ((t1 / u) / (-u - t1))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v / (-t1 - (u * 2.0));
	double tmp;
	if (t1 <= -0.16) {
		tmp = t_1;
	} else if (t1 <= -1.65e-73) {
		tmp = t1 * ((v / -u) / (t1 + u));
	} else if ((t1 <= -1.1e-103) || !(t1 <= 6.6e-161)) {
		tmp = t_1;
	} else {
		tmp = v * ((t1 / u) / (-u - t1));
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v / (-t1 - (u * 2.0))
	tmp = 0
	if t1 <= -0.16:
		tmp = t_1
	elif t1 <= -1.65e-73:
		tmp = t1 * ((v / -u) / (t1 + u))
	elif (t1 <= -1.1e-103) or not (t1 <= 6.6e-161):
		tmp = t_1
	else:
		tmp = v * ((t1 / u) / (-u - t1))
	return tmp
function code(u, v, t1)
	t_1 = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)))
	tmp = 0.0
	if (t1 <= -0.16)
		tmp = t_1;
	elseif (t1 <= -1.65e-73)
		tmp = Float64(t1 * Float64(Float64(v / Float64(-u)) / Float64(t1 + u)));
	elseif ((t1 <= -1.1e-103) || !(t1 <= 6.6e-161))
		tmp = t_1;
	else
		tmp = Float64(v * Float64(Float64(t1 / u) / Float64(Float64(-u) - t1)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v / (-t1 - (u * 2.0));
	tmp = 0.0;
	if (t1 <= -0.16)
		tmp = t_1;
	elseif (t1 <= -1.65e-73)
		tmp = t1 * ((v / -u) / (t1 + u));
	elseif ((t1 <= -1.1e-103) || ~((t1 <= 6.6e-161)))
		tmp = t_1;
	else
		tmp = v * ((t1 / u) / (-u - t1));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -0.16], t$95$1, If[LessEqual[t1, -1.65e-73], N[(t1 * N[(N[(v / (-u)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t1, -1.1e-103], N[Not[LessEqual[t1, 6.6e-161]], $MachinePrecision]], t$95$1, N[(v * N[(N[(t1 / u), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{v}{\left(-t1\right) - u \cdot 2}\\
\mathbf{if}\;t1 \leq -0.16:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t1 \leq -1.1 \cdot 10^{-103} \lor \neg \left(t1 \leq 6.6 \cdot 10^{-161}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -0.160000000000000003 or -1.65000000000000002e-73 < t1 < -1.1e-103 or 6.5999999999999997e-161 < t1

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative83.4%

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

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

    if -0.160000000000000003 < t1 < -1.65000000000000002e-73

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

    if -1.1e-103 < t1 < 6.5999999999999997e-161

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{u \cdot \left(t1 + u\right)}} \]
    7. Step-by-step derivation
      1. mul-1-neg70.0%

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

        \[\leadsto -\color{blue}{\frac{\frac{t1 \cdot v}{u}}{t1 + u}} \]
      3. associate-*r/81.4%

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

        \[\leadsto \color{blue}{\frac{-t1 \cdot \frac{v}{u}}{t1 + u}} \]
      5. distribute-rgt-neg-in81.4%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{u \cdot \left(t1 + u\right)}} \]
    10. Step-by-step derivation
      1. mul-1-neg70.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -0.16:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{elif}\;t1 \leq -1.65 \cdot 10^{-73}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{-u}}{t1 + u}\\ \mathbf{elif}\;t1 \leq -1.1 \cdot 10^{-103} \lor \neg \left(t1 \leq 6.6 \cdot 10^{-161}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{\left(-u\right) - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 76.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{v}{\left(-t1\right) - u \cdot 2}\\ t_2 := \left(-u\right) - t1\\ \mathbf{if}\;t1 \leq -8 \cdot 10^{-6}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq -1.9 \cdot 10^{-74}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{-u}}{t1 + u}\\ \mathbf{elif}\;t1 \leq -1.06 \cdot 10^{-103}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t1 \leq 6.6 \cdot 10^{-161}:\\ \;\;\;\;v \cdot \frac{\frac{t1}{u}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{t\_2} \cdot \frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ v (- (- t1) (* u 2.0)))) (t_2 (- (- u) t1)))
   (if (<= t1 -8e-6)
     t_1
     (if (<= t1 -1.9e-74)
       (* t1 (/ (/ v (- u)) (+ t1 u)))
       (if (<= t1 -1.06e-103)
         t_1
         (if (<= t1 6.6e-161)
           (* v (/ (/ t1 u) t_2))
           (* (/ t1 t_2) (/ v t1))))))))
double code(double u, double v, double t1) {
	double t_1 = v / (-t1 - (u * 2.0));
	double t_2 = -u - t1;
	double tmp;
	if (t1 <= -8e-6) {
		tmp = t_1;
	} else if (t1 <= -1.9e-74) {
		tmp = t1 * ((v / -u) / (t1 + u));
	} else if (t1 <= -1.06e-103) {
		tmp = t_1;
	} else if (t1 <= 6.6e-161) {
		tmp = v * ((t1 / u) / t_2);
	} else {
		tmp = (t1 / t_2) * (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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = v / (-t1 - (u * 2.0d0))
    t_2 = -u - t1
    if (t1 <= (-8d-6)) then
        tmp = t_1
    else if (t1 <= (-1.9d-74)) then
        tmp = t1 * ((v / -u) / (t1 + u))
    else if (t1 <= (-1.06d-103)) then
        tmp = t_1
    else if (t1 <= 6.6d-161) then
        tmp = v * ((t1 / u) / t_2)
    else
        tmp = (t1 / t_2) * (v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v / (-t1 - (u * 2.0));
	double t_2 = -u - t1;
	double tmp;
	if (t1 <= -8e-6) {
		tmp = t_1;
	} else if (t1 <= -1.9e-74) {
		tmp = t1 * ((v / -u) / (t1 + u));
	} else if (t1 <= -1.06e-103) {
		tmp = t_1;
	} else if (t1 <= 6.6e-161) {
		tmp = v * ((t1 / u) / t_2);
	} else {
		tmp = (t1 / t_2) * (v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v / (-t1 - (u * 2.0))
	t_2 = -u - t1
	tmp = 0
	if t1 <= -8e-6:
		tmp = t_1
	elif t1 <= -1.9e-74:
		tmp = t1 * ((v / -u) / (t1 + u))
	elif t1 <= -1.06e-103:
		tmp = t_1
	elif t1 <= 6.6e-161:
		tmp = v * ((t1 / u) / t_2)
	else:
		tmp = (t1 / t_2) * (v / t1)
	return tmp
function code(u, v, t1)
	t_1 = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)))
	t_2 = Float64(Float64(-u) - t1)
	tmp = 0.0
	if (t1 <= -8e-6)
		tmp = t_1;
	elseif (t1 <= -1.9e-74)
		tmp = Float64(t1 * Float64(Float64(v / Float64(-u)) / Float64(t1 + u)));
	elseif (t1 <= -1.06e-103)
		tmp = t_1;
	elseif (t1 <= 6.6e-161)
		tmp = Float64(v * Float64(Float64(t1 / u) / t_2));
	else
		tmp = Float64(Float64(t1 / t_2) * Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v / (-t1 - (u * 2.0));
	t_2 = -u - t1;
	tmp = 0.0;
	if (t1 <= -8e-6)
		tmp = t_1;
	elseif (t1 <= -1.9e-74)
		tmp = t1 * ((v / -u) / (t1 + u));
	elseif (t1 <= -1.06e-103)
		tmp = t_1;
	elseif (t1 <= 6.6e-161)
		tmp = v * ((t1 / u) / t_2);
	else
		tmp = (t1 / t_2) * (v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-u) - t1), $MachinePrecision]}, If[LessEqual[t1, -8e-6], t$95$1, If[LessEqual[t1, -1.9e-74], N[(t1 * N[(N[(v / (-u)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, -1.06e-103], t$95$1, If[LessEqual[t1, 6.6e-161], N[(v * N[(N[(t1 / u), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / t$95$2), $MachinePrecision] * N[(v / t1), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{v}{\left(-t1\right) - u \cdot 2}\\
t_2 := \left(-u\right) - t1\\
\mathbf{if}\;t1 \leq -8 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t1 \leq -1.06 \cdot 10^{-103}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t1 \leq 6.6 \cdot 10^{-161}:\\
\;\;\;\;v \cdot \frac{\frac{t1}{u}}{t\_2}\\

\mathbf{else}:\\
\;\;\;\;\frac{t1}{t\_2} \cdot \frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t1 < -7.99999999999999964e-6 or -1.8999999999999998e-74 < t1 < -1.06000000000000004e-103

    1. Initial program 65.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative85.6%

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

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

    if -7.99999999999999964e-6 < t1 < -1.8999999999999998e-74

    1. Initial program 82.7%

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

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

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

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

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

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

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

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

    if -1.06000000000000004e-103 < t1 < 6.5999999999999997e-161

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{u \cdot \left(t1 + u\right)}} \]
    7. Step-by-step derivation
      1. mul-1-neg70.0%

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

        \[\leadsto -\color{blue}{\frac{\frac{t1 \cdot v}{u}}{t1 + u}} \]
      3. associate-*r/81.4%

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

        \[\leadsto \color{blue}{\frac{-t1 \cdot \frac{v}{u}}{t1 + u}} \]
      5. distribute-rgt-neg-in81.4%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t1 \cdot v}{u \cdot \left(t1 + u\right)}} \]
    10. Step-by-step derivation
      1. mul-1-neg70.0%

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

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

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

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

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

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

    if 6.5999999999999997e-161 < t1

    1. Initial program 69.2%

      \[\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 82.4%

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

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

Alternative 5: 90.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{+135}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{elif}\;t1 \leq 5.8 \cdot 10^{+130}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -4e+135)
   (/ v (- (- t1) (* u 2.0)))
   (if (<= t1 5.8e+130) (* t1 (/ (/ v (+ t1 u)) (- (- u) t1))) (/ v (- t1)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -4e+135) {
		tmp = v / (-t1 - (u * 2.0));
	} else if (t1 <= 5.8e+130) {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	} 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 <= (-4d+135)) then
        tmp = v / (-t1 - (u * 2.0d0))
    else if (t1 <= 5.8d+130) then
        tmp = t1 * ((v / (t1 + u)) / (-u - t1))
    else
        tmp = v / -t1
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -4e+135) {
		tmp = v / (-t1 - (u * 2.0));
	} else if (t1 <= 5.8e+130) {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	} else {
		tmp = v / -t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -4e+135:
		tmp = v / (-t1 - (u * 2.0))
	elif t1 <= 5.8e+130:
		tmp = t1 * ((v / (t1 + u)) / (-u - t1))
	else:
		tmp = v / -t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -4e+135)
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	elseif (t1 <= 5.8e+130)
		tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1)));
	else
		tmp = Float64(v / Float64(-t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -4e+135)
		tmp = v / (-t1 - (u * 2.0));
	elseif (t1 <= 5.8e+130)
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	else
		tmp = v / -t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -4e+135], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 5.8e+130], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4 \cdot 10^{+135}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\

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

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


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

    1. Initial program 53.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999985e135 < t1 < 5.7999999999999998e130

    1. Initial program 78.8%

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

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

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

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

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

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

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

    if 5.7999999999999998e130 < t1

    1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified91.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4 \cdot 10^{+135}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{elif}\;t1 \leq 5.8 \cdot 10^{+130}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -0.0085 \lor \neg \left(t1 \leq 6.6 \cdot 10^{-161}\right):\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{-u}}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -0.0085) (not (<= t1 6.6e-161)))
   (/ v (- (- t1) (* u 2.0)))
   (* t1 (/ (/ v (- u)) (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -0.0085) || !(t1 <= 6.6e-161)) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = t1 * ((v / -u) / (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.0085d0)) .or. (.not. (t1 <= 6.6d-161))) then
        tmp = v / (-t1 - (u * 2.0d0))
    else
        tmp = t1 * ((v / -u) / (t1 + u))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -0.0085) || !(t1 <= 6.6e-161)) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = t1 * ((v / -u) / (t1 + u));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -0.0085) or not (t1 <= 6.6e-161):
		tmp = v / (-t1 - (u * 2.0))
	else:
		tmp = t1 * ((v / -u) / (t1 + u))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -0.0085) || !(t1 <= 6.6e-161))
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	else
		tmp = Float64(t1 * Float64(Float64(v / Float64(-u)) / Float64(t1 + u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -0.0085) || ~((t1 <= 6.6e-161)))
		tmp = v / (-t1 - (u * 2.0));
	else
		tmp = t1 * ((v / -u) / (t1 + u));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -0.0085], N[Not[LessEqual[t1, 6.6e-161]], $MachinePrecision]], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(N[(v / (-u)), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -0.0085 \lor \neg \left(t1 \leq 6.6 \cdot 10^{-161}\right):\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -0.0085000000000000006 or 6.5999999999999997e-161 < t1

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative83.3%

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

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

    if -0.0085000000000000006 < t1 < 6.5999999999999997e-161

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

Alternative 7: 76.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t1}{\left(-u\right) - t1}\\ \mathbf{if}\;t1 \leq -4.4 \cdot 10^{-14}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{elif}\;t1 \leq 6.6 \cdot 10^{-161}:\\ \;\;\;\;t\_1 \cdot \frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (/ t1 (- (- u) t1))))
   (if (<= t1 -4.4e-14)
     (/ v (- (- t1) (* u 2.0)))
     (if (<= t1 6.6e-161) (* t_1 (/ v u)) (* t_1 (/ v t1))))))
double code(double u, double v, double t1) {
	double t_1 = t1 / (-u - t1);
	double tmp;
	if (t1 <= -4.4e-14) {
		tmp = v / (-t1 - (u * 2.0));
	} else if (t1 <= 6.6e-161) {
		tmp = t_1 * (v / u);
	} else {
		tmp = t_1 * (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) :: t_1
    real(8) :: tmp
    t_1 = t1 / (-u - t1)
    if (t1 <= (-4.4d-14)) then
        tmp = v / (-t1 - (u * 2.0d0))
    else if (t1 <= 6.6d-161) then
        tmp = t_1 * (v / u)
    else
        tmp = t_1 * (v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = t1 / (-u - t1);
	double tmp;
	if (t1 <= -4.4e-14) {
		tmp = v / (-t1 - (u * 2.0));
	} else if (t1 <= 6.6e-161) {
		tmp = t_1 * (v / u);
	} else {
		tmp = t_1 * (v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = t1 / (-u - t1)
	tmp = 0
	if t1 <= -4.4e-14:
		tmp = v / (-t1 - (u * 2.0))
	elif t1 <= 6.6e-161:
		tmp = t_1 * (v / u)
	else:
		tmp = t_1 * (v / t1)
	return tmp
function code(u, v, t1)
	t_1 = Float64(t1 / Float64(Float64(-u) - t1))
	tmp = 0.0
	if (t1 <= -4.4e-14)
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	elseif (t1 <= 6.6e-161)
		tmp = Float64(t_1 * Float64(v / u));
	else
		tmp = Float64(t_1 * Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = t1 / (-u - t1);
	tmp = 0.0;
	if (t1 <= -4.4e-14)
		tmp = v / (-t1 - (u * 2.0));
	elseif (t1 <= 6.6e-161)
		tmp = t_1 * (v / u);
	else
		tmp = t_1 * (v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(t1 / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -4.4e-14], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.6e-161], N[(t$95$1 * N[(v / u), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(v / t1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t1}{\left(-u\right) - t1}\\
\mathbf{if}\;t1 \leq -4.4 \cdot 10^{-14}:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\

\mathbf{elif}\;t1 \leq 6.6 \cdot 10^{-161}:\\
\;\;\;\;t\_1 \cdot \frac{v}{u}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{v}{t1}\\


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

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative85.5%

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

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

    if -4.4000000000000002e-14 < t1 < 6.5999999999999997e-161

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

    if 6.5999999999999997e-161 < t1

    1. Initial program 69.2%

      \[\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 82.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -4.4 \cdot 10^{-14}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{elif}\;t1 \leq 6.6 \cdot 10^{-161}:\\ \;\;\;\;\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 76.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-u\right) - t1\\ \mathbf{if}\;t1 \leq -0.00115:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{elif}\;t1 \leq 6.5 \cdot 10^{-161}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{t\_1} \cdot \frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (- (- u) t1)))
   (if (<= t1 -0.00115)
     (/ v (- (- t1) (* u 2.0)))
     (if (<= t1 6.5e-161) (/ (* t1 (/ v u)) t_1) (* (/ t1 t_1) (/ v t1))))))
double code(double u, double v, double t1) {
	double t_1 = -u - t1;
	double tmp;
	if (t1 <= -0.00115) {
		tmp = v / (-t1 - (u * 2.0));
	} else if (t1 <= 6.5e-161) {
		tmp = (t1 * (v / u)) / t_1;
	} else {
		tmp = (t1 / t_1) * (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) :: t_1
    real(8) :: tmp
    t_1 = -u - t1
    if (t1 <= (-0.00115d0)) then
        tmp = v / (-t1 - (u * 2.0d0))
    else if (t1 <= 6.5d-161) then
        tmp = (t1 * (v / u)) / t_1
    else
        tmp = (t1 / t_1) * (v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = -u - t1;
	double tmp;
	if (t1 <= -0.00115) {
		tmp = v / (-t1 - (u * 2.0));
	} else if (t1 <= 6.5e-161) {
		tmp = (t1 * (v / u)) / t_1;
	} else {
		tmp = (t1 / t_1) * (v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = -u - t1
	tmp = 0
	if t1 <= -0.00115:
		tmp = v / (-t1 - (u * 2.0))
	elif t1 <= 6.5e-161:
		tmp = (t1 * (v / u)) / t_1
	else:
		tmp = (t1 / t_1) * (v / t1)
	return tmp
function code(u, v, t1)
	t_1 = Float64(Float64(-u) - t1)
	tmp = 0.0
	if (t1 <= -0.00115)
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	elseif (t1 <= 6.5e-161)
		tmp = Float64(Float64(t1 * Float64(v / u)) / t_1);
	else
		tmp = Float64(Float64(t1 / t_1) * Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = -u - t1;
	tmp = 0.0;
	if (t1 <= -0.00115)
		tmp = v / (-t1 - (u * 2.0));
	elseif (t1 <= 6.5e-161)
		tmp = (t1 * (v / u)) / t_1;
	else
		tmp = (t1 / t_1) * (v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[((-u) - t1), $MachinePrecision]}, If[LessEqual[t1, -0.00115], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 6.5e-161], N[(N[(t1 * N[(v / u), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(t1 / t$95$1), $MachinePrecision] * N[(v / t1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-u\right) - t1\\
\mathbf{if}\;t1 \leq -0.00115:\\
\;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\

\mathbf{elif}\;t1 \leq 6.5 \cdot 10^{-161}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{u}}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{t1}{t\_1} \cdot \frac{v}{t1}\\


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

    1. Initial program 63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative85.5%

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

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

    if -0.00115 < t1 < 6.50000000000000008e-161

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\frac{t1 \cdot v}{u}}{t1 + u}} \]
      3. associate-*r/77.6%

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

        \[\leadsto \color{blue}{\frac{-t1 \cdot \frac{v}{u}}{t1 + u}} \]
      5. distribute-rgt-neg-in77.6%

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

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

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

    if 6.50000000000000008e-161 < t1

    1. Initial program 69.2%

      \[\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 82.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -0.00115:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{elif}\;t1 \leq 6.5 \cdot 10^{-161}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{u}}{\left(-u\right) - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 68.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -4 \cdot 10^{+112} \lor \neg \left(u \leq 7.8 \cdot 10^{+217}\right):\\ \;\;\;\;t1 \cdot \frac{v}{u \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -4e+112) (not (<= u 7.8e+217)))
   (* t1 (/ v (* u (+ t1 u))))
   (/ v (- (- t1) (* u 2.0)))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -4e+112) || !(u <= 7.8e+217)) {
		tmp = t1 * (v / (u * (t1 + u)));
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	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 <= (-4d+112)) .or. (.not. (u <= 7.8d+217))) then
        tmp = t1 * (v / (u * (t1 + u)))
    else
        tmp = v / (-t1 - (u * 2.0d0))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -4e+112) || !(u <= 7.8e+217)) {
		tmp = t1 * (v / (u * (t1 + u)));
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -4e+112) or not (u <= 7.8e+217):
		tmp = t1 * (v / (u * (t1 + u)))
	else:
		tmp = v / (-t1 - (u * 2.0))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -4e+112) || !(u <= 7.8e+217))
		tmp = Float64(t1 * Float64(v / Float64(u * Float64(t1 + u))));
	else
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -4e+112) || ~((u <= 7.8e+217)))
		tmp = t1 * (v / (u * (t1 + u)));
	else
		tmp = v / (-t1 - (u * 2.0));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -4e+112], N[Not[LessEqual[u, 7.8e+217]], $MachinePrecision]], N[(t1 * N[(v / N[(u * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -4 \cdot 10^{+112} \lor \neg \left(u \leq 7.8 \cdot 10^{+217}\right):\\
\;\;\;\;t1 \cdot \frac{v}{u \cdot \left(t1 + u\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.9999999999999997e112 or 7.79999999999999986e217 < u

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t1 \cdot \frac{v}{u \cdot \left(t1 + u\right)}} \]

    if -3.9999999999999997e112 < u < 7.79999999999999986e217

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative68.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -4 \cdot 10^{+112} \lor \neg \left(u \leq 7.8 \cdot 10^{+217}\right):\\ \;\;\;\;t1 \cdot \frac{v}{u \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := u \cdot \left(t1 + u\right)\\ \mathbf{if}\;u \leq -3.1 \cdot 10^{+106}:\\ \;\;\;\;v \cdot \frac{t1}{t\_1}\\ \mathbf{elif}\;u \leq 1.75 \cdot 10^{+217}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{v}{t\_1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* u (+ t1 u))))
   (if (<= u -3.1e+106)
     (* v (/ t1 t_1))
     (if (<= u 1.75e+217) (/ v (- (- t1) (* u 2.0))) (* t1 (/ v t_1))))))
double code(double u, double v, double t1) {
	double t_1 = u * (t1 + u);
	double tmp;
	if (u <= -3.1e+106) {
		tmp = v * (t1 / t_1);
	} else if (u <= 1.75e+217) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = t1 * (v / t_1);
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = u * (t1 + u)
    if (u <= (-3.1d+106)) then
        tmp = v * (t1 / t_1)
    else if (u <= 1.75d+217) then
        tmp = v / (-t1 - (u * 2.0d0))
    else
        tmp = t1 * (v / t_1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = u * (t1 + u);
	double tmp;
	if (u <= -3.1e+106) {
		tmp = v * (t1 / t_1);
	} else if (u <= 1.75e+217) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = t1 * (v / t_1);
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = u * (t1 + u)
	tmp = 0
	if u <= -3.1e+106:
		tmp = v * (t1 / t_1)
	elif u <= 1.75e+217:
		tmp = v / (-t1 - (u * 2.0))
	else:
		tmp = t1 * (v / t_1)
	return tmp
function code(u, v, t1)
	t_1 = Float64(u * Float64(t1 + u))
	tmp = 0.0
	if (u <= -3.1e+106)
		tmp = Float64(v * Float64(t1 / t_1));
	elseif (u <= 1.75e+217)
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	else
		tmp = Float64(t1 * Float64(v / t_1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = u * (t1 + u);
	tmp = 0.0;
	if (u <= -3.1e+106)
		tmp = v * (t1 / t_1);
	elseif (u <= 1.75e+217)
		tmp = v / (-t1 - (u * 2.0));
	else
		tmp = t1 * (v / t_1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(u * N[(t1 + u), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[u, -3.1e+106], N[(v * N[(t1 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.75e+217], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t1 * N[(v / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := u \cdot \left(t1 + u\right)\\
\mathbf{if}\;u \leq -3.1 \cdot 10^{+106}:\\
\;\;\;\;v \cdot \frac{t1}{t\_1}\\

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

\mathbf{else}:\\
\;\;\;\;t1 \cdot \frac{v}{t\_1}\\


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

    1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t1}{u \cdot \left(t1 + u\right)} \cdot v} \]

    if -3.0999999999999999e106 < u < 1.7499999999999999e217

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative68.4%

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

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

    if 1.7499999999999999e217 < u

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.1 \cdot 10^{+106}:\\ \;\;\;\;v \cdot \frac{t1}{u \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;u \leq 1.75 \cdot 10^{+217}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;t1 \cdot \frac{v}{u \cdot \left(t1 + u\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 68.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -4 \cdot 10^{+112}:\\ \;\;\;\;v \cdot \frac{t1}{u \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;u \leq 1.75 \cdot 10^{+217}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -4e+112)
   (* v (/ t1 (* u (+ t1 u))))
   (if (<= u 1.75e+217)
     (/ v (- (- t1) (* u 2.0)))
     (/ (/ t1 (+ t1 u)) (/ u v)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -4e+112) {
		tmp = v * (t1 / (u * (t1 + u)));
	} else if (u <= 1.75e+217) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = (t1 / (t1 + u)) / (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 <= (-4d+112)) then
        tmp = v * (t1 / (u * (t1 + u)))
    else if (u <= 1.75d+217) then
        tmp = v / (-t1 - (u * 2.0d0))
    else
        tmp = (t1 / (t1 + u)) / (u / v)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -4e+112) {
		tmp = v * (t1 / (u * (t1 + u)));
	} else if (u <= 1.75e+217) {
		tmp = v / (-t1 - (u * 2.0));
	} else {
		tmp = (t1 / (t1 + u)) / (u / v);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -4e+112:
		tmp = v * (t1 / (u * (t1 + u)))
	elif u <= 1.75e+217:
		tmp = v / (-t1 - (u * 2.0))
	else:
		tmp = (t1 / (t1 + u)) / (u / v)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -4e+112)
		tmp = Float64(v * Float64(t1 / Float64(u * Float64(t1 + u))));
	elseif (u <= 1.75e+217)
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	else
		tmp = Float64(Float64(t1 / Float64(t1 + u)) / Float64(u / v));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -4e+112)
		tmp = v * (t1 / (u * (t1 + u)));
	elseif (u <= 1.75e+217)
		tmp = v / (-t1 - (u * 2.0));
	else
		tmp = (t1 / (t1 + u)) / (u / v);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -4e+112], N[(v * N[(t1 / N[(u * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.75e+217], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -4 \cdot 10^{+112}:\\
\;\;\;\;v \cdot \frac{t1}{u \cdot \left(t1 + u\right)}\\

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

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


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

    1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{t1}{u \cdot \left(t1 + u\right)} \cdot v} \]

    if -3.9999999999999997e112 < u < 1.7499999999999999e217

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative68.4%

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

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

    if 1.7499999999999999e217 < u

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\color{blue}{\left(t1 + u\right)} \cdot \frac{1}{\frac{v}{u}}} \]
      9. clear-num83.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -4 \cdot 10^{+112}:\\ \;\;\;\;v \cdot \frac{t1}{u \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;u \leq 1.75 \cdot 10^{+217}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 67.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+110} \lor \neg \left(u \leq 3.6 \cdot 10^{+217}\right):\\ \;\;\;\;\frac{\frac{t1}{u}}{\frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.7e+110) (not (<= u 3.6e+217)))
   (/ (/ t1 u) (/ u v))
   (/ v (- (- t1) (* u 2.0)))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.7e+110) || !(u <= 3.6e+217)) {
		tmp = (t1 / u) / (u / v);
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	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.7d+110)) .or. (.not. (u <= 3.6d+217))) then
        tmp = (t1 / u) / (u / v)
    else
        tmp = v / (-t1 - (u * 2.0d0))
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.7e+110) || !(u <= 3.6e+217)) {
		tmp = (t1 / u) / (u / v);
	} else {
		tmp = v / (-t1 - (u * 2.0));
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.7e+110) or not (u <= 3.6e+217):
		tmp = (t1 / u) / (u / v)
	else:
		tmp = v / (-t1 - (u * 2.0))
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.7e+110) || !(u <= 3.6e+217))
		tmp = Float64(Float64(t1 / u) / Float64(u / v));
	else
		tmp = Float64(v / Float64(Float64(-t1) - Float64(u * 2.0)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -1.7e+110) || ~((u <= 3.6e+217)))
		tmp = (t1 / u) / (u / v);
	else
		tmp = v / (-t1 - (u * 2.0));
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.7e+110], N[Not[LessEqual[u, 3.6e+217]], $MachinePrecision]], N[(N[(t1 / u), $MachinePrecision] / N[(u / v), $MachinePrecision]), $MachinePrecision], N[(v / N[((-t1) - N[(u * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.7 \cdot 10^{+110} \lor \neg \left(u \leq 3.6 \cdot 10^{+217}\right):\\
\;\;\;\;\frac{\frac{t1}{u}}{\frac{u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.7000000000000001e110 or 3.6000000000000002e217 < u

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}} \]
    10. Taylor expanded in t1 around 0 73.0%

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

    if -1.7000000000000001e110 < u < 3.6000000000000002e217

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative68.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+110} \lor \neg \left(u \leq 3.6 \cdot 10^{+217}\right):\\ \;\;\;\;\frac{\frac{t1}{u}}{\frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{\left(-t1\right) - u \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 67.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2 \cdot 10^{+110} \lor \neg \left(u \leq 1.75 \cdot 10^{+217}\right):\\
\;\;\;\;\frac{\frac{t1}{u}}{\frac{u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2e110 or 1.7499999999999999e217 < u

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}} \]
    10. Taylor expanded in t1 around 0 73.0%

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

    if -2e110 < u < 1.7499999999999999e217

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    6. Applied egg-rr99.3%

      \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 67.6%

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

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

        \[\leadsto \color{blue}{-\frac{v}{t1 + u}} \]
      2. distribute-neg-frac67.6%

        \[\leadsto \color{blue}{\frac{-v}{t1 + u}} \]
    10. Simplified67.6%

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

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

Alternative 14: 59.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -6 \cdot 10^{+176} \lor \neg \left(u \leq 2.7 \cdot 10^{+199}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -6e+176) (not (<= u 2.7e+199))) (/ v u) (/ v (- t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -6e+176) || !(u <= 2.7e+199)) {
		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 <= (-6d+176)) .or. (.not. (u <= 2.7d+199))) 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 <= -6e+176) || !(u <= 2.7e+199)) {
		tmp = v / u;
	} else {
		tmp = v / -t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -6e+176) or not (u <= 2.7e+199):
		tmp = v / u
	else:
		tmp = v / -t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -6e+176) || !(u <= 2.7e+199))
		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 <= -6e+176) || ~((u <= 2.7e+199)))
		tmp = v / u;
	else
		tmp = v / -t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -6e+176], N[Not[LessEqual[u, 2.7e+199]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -6 \cdot 10^{+176} \lor \neg \left(u \leq 2.7 \cdot 10^{+199}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -6e176 or 2.6999999999999999e199 < u

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}} \]
    9. Simplified73.2%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}} \]
    10. Taylor expanded in t1 around inf 46.6%

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

    if -6e176 < u < 2.6999999999999999e199

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 59.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.4 \cdot 10^{+176} \lor \neg \left(u \leq 3.3 \cdot 10^{+198}\right):\\ \;\;\;\;\frac{v}{-u}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{-t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.4e+176) (not (<= u 3.3e+198))) (/ v (- u)) (/ v (- t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.4e+176) || !(u <= 3.3e+198)) {
		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 <= (-1.4d+176)) .or. (.not. (u <= 3.3d+198))) 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 <= -1.4e+176) || !(u <= 3.3e+198)) {
		tmp = v / -u;
	} else {
		tmp = v / -t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.4e+176) or not (u <= 3.3e+198):
		tmp = v / -u
	else:
		tmp = v / -t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.4e+176) || !(u <= 3.3e+198))
		tmp = Float64(v / Float64(-u));
	else
		tmp = Float64(v / Float64(-t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -1.4e+176) || ~((u <= 3.3e+198)))
		tmp = v / -u;
	else
		tmp = v / -t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.4e+176], N[Not[LessEqual[u, 3.3e+198]], $MachinePrecision]], N[(v / (-u)), $MachinePrecision], N[(v / (-t1)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.4 \cdot 10^{+176} \lor \neg \left(u \leq 3.3 \cdot 10^{+198}\right):\\
\;\;\;\;\frac{v}{-u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.4000000000000001e176 or 3.29999999999999994e198 < u

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4000000000000001e176 < u < 3.29999999999999994e198

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 23.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -4.7 \cdot 10^{+78} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+130}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -4.7e+78) (not (<= t1 3.6e+130))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -4.7e+78) || !(t1 <= 3.6e+130)) {
		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 ((t1 <= (-4.7d+78)) .or. (.not. (t1 <= 3.6d+130))) 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 ((t1 <= -4.7e+78) || !(t1 <= 3.6e+130)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -4.7e+78) or not (t1 <= 3.6e+130):
		tmp = v / t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -4.7e+78) || !(t1 <= 3.6e+130))
		tmp = Float64(v / t1);
	else
		tmp = Float64(v / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -4.7e+78) || ~((t1 <= 3.6e+130)))
		tmp = v / t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -4.7e+78], N[Not[LessEqual[t1, 3.6e+130]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -4.7 \cdot 10^{+78} \lor \neg \left(t1 \leq 3.6 \cdot 10^{+130}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -4.70000000000000006e78 or 3.6000000000000001e130 < t1

    1. Initial program 48.2%

      \[\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 89.8%

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

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

    if -4.70000000000000006e78 < t1 < 3.6000000000000001e130

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}} \]
    9. Simplified38.2%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u}}{\frac{u}{v}}} \]
    10. Taylor expanded in t1 around inf 19.6%

      \[\leadsto \color{blue}{\frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification26.0%

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

Alternative 17: 98.0% accurate, 1.0× speedup?

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

\\
\frac{v}{t1 + u} \cdot \frac{t1}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 69.9%

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

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

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

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

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

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

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

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

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

Alternative 18: 62.1% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{v}{\left(-u\right) - 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(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}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 69.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{t1 \cdot \frac{v}{t1 + u}}{-1}}{t1 + u}} \]
  7. Taylor expanded in t1 around inf 62.7%

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

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

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

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

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

    \[\leadsto \frac{v}{\left(-u\right) - t1} \]
  12. Add Preprocessing

Alternative 19: 13.9% 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.9%

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified99.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 58.4%

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

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  7. Final simplification15.6%

    \[\leadsto \frac{v}{t1} \]
  8. Add Preprocessing

Reproduce

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